Hey,
I compiled the LPFW ( Leopard Flower Personal Firewall) and want to start the daemon automatically on each boot. For this, I thought a init.d script would be what I need (please correct me if I’m wrong). It looks like:
lpfw.conf:
#!/bin/bash
LPFW=/usr/bin/lpfw
KILLALL=/usr/bin/killall
case "$1" in
start)
echo "Starting lpfw..."
$LPFW
;;
stop)
echo "Stopping lpfw..."
$KILLALL lpfw
;;
restart)
$0 stop
$0 start
;;
status) wor
;;
*)
echo "Usage: $0 {start|stop|restart|status}"
;;
esac
And it should be executable:
/etc/init.d> ls -l lpfw.conf
-rwxr-xr-x 1 root root 378 Dec 26 18:42 lpfw.conf
But unfortunately, when I check after login whether lpfw is running with pgrep, I see its not. However, starting the script directly with root privileges works fine:
/etc/init.d> sudo ./lpfw.conf start
Starting lpfw...
What am I doing wrong? are the init.d script started as root? What is the correct log to check for errors during executing these scripts?
Thanks for your help in advance!