I am setting up a script to run FUPPES at boot time. I am used to using rc.local, but SUSE’s boot.local is run BEFORE the network is initiated, so that does not seem to be a good solution.
My solution: I took the /etc/init.d/skeleton script and went from there. Basically all I changed was the path to the executable (I’ll paste the script at the bottom of the post).
I set the Dependencies to $ALL and included a sleep 20
before the binary /usr/local/bin/fuppesd is executed because my wlan0 interface takes a few seconds to get DHCP done with. I set it to 20 just to be sure this was not the problem (as it had been before the addition of the sleep command).
To test the script out I run /etc/init.d/fuppesd_script start and it starts up and runs perfectly (status gives the right output, I can connect to the stream from my Xbox, and I can view the web interface.)
When I reboot the computer, however, the status is shown as running and a ps aux | grep fuppesd
shows that the binary is running. I cannot, however, connect via my Xbox or load the web interface.
FUPPES depends on config files in ~/.fuppes, but if they are not present it will simply create a default set, so they do not seem to be missing.
Is there some debugging suggestions I should use? Am I missing an argument in the startproc line? Any help is much appreciated.
#!/bin/sh
### BEGIN INIT INFO
# Provides: fuppes
# Required-Start: $ALL
# Should-Start: $time ypbind smtp
# Required-Stop: $syslog $remote_fs
# Should-Stop: ypbind smtp
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Short-Description: FUPPES daemon
# Description: Start FUPPES Media Server
### END INIT INFO
FOO_BIN=/usr/local/bin/fuppesd
test -x $FOO_BIN || { echo "$FOO_BIN not installed";
if "$1" = "stop" ]; then exit 0;
else exit 5; fi; }
#FOO_CONFIG=/var/lib/fuppes/.fuppes/fuppes.cfg
#test -r $FOO_CONFIG || { echo "$FOO_CONFIG not existing";
# if "$1" = "stop" ]; then exit 0;
# else exit 6; fi; }
#. $FOO_CONFIG
. /etc/rc.status
rc_reset
case "$1" in
start)
echo -n "Starting Fuppes "
sleep 20
/sbin/startproc $FOO_BIN
rc_status -v
;;
stop)
echo -n "Shutting down FUPPES "
/sbin/killproc -TERM $FOO_BIN
rc_status -v
;;
try-restart|condrestart)
if test "$1" = "condrestart"; then
echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}"
fi
$0 status
if test $? = 0; then
$0 restart
else
rc_reset
fi
rc_status
;;
restart)
$0 stop
$0 start
rc_status
;;
force-reload)
echo -n "Reload service FUPPES "
/sbin/killproc -HUP $FOO_BIN
rc_status -v
;;
reload)
echo -n "Reload service FUPPES "
/sbin/killproc -HUP $FOO_BIN
rc_status -v
;;
status)
echo -n "Checking for service FUPPES "
/sbin/checkproc $FOO_BIN
rc_status -v
;;
probe)
test /etc/FOO/FOO.conf -nt /var/run/FOO.pid && echo reload
;;
*)
echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}"
exit 1
;;
esac
rc_exit