I am trying to get Chandler running on a debian box on startup under user 'chandler', and have tried the following script, locating it in init.d:
#! /bin/sh
#
# /etc/init.d/chandler
#
RETVAL=$?
CHANDLER_HOME="/chandler"
# check input
case "$1" in
start)
if [ -f $CHANDLER_HOME/bin/osafsrvctl ];
then
/bin/su chandler $CHANDLER_HOME/bin/osafsrvctl start
fi
;;
stop)
if [ -f $CHANDLER_HOME/bin/osafsrvctl ];
then
/bin/su chandler $CHANDLER_HOME/bin/osafsrvctl stop
fi
;;
*)
echo "Usage: /etc/init.d/osafsrvctl {start|stop}"
exit 1
;;
esac
exit $RETVAL
I then ran:
update-rc.d chandler defaults
I've checked that the startup scrip in init.d has 755 permissions... but no joy.
Am I missing something obvious here?
Thanks for any pointers.
UPDATE: per the suggestions below, here is the init header I've added to the script:
### BEGIN INIT INFO
# Provides: chandler
# Required-Start: $local_fs $remote_fs $network $syslog
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start/stop chandler server
### END INIT INFO