Talvez você possa fazer algo como o seguinte. Basta substituir abaixo pelo seu script e colocar o script em /etc/init.d
#!/bin/sh
#
# myservice This shell script takes care of starting and stopping
# the <myservice>
#
# Source function library
. /etc/rc.d/init.d/functions
# Do preliminary checks here, if any
#### START of preliminary checks #########
##### END of preliminary checks #######
# Handle manual control parameters like start, stop, status, restart, etc.
case "$1" in
start)
# Start daemons.
echo -n $"Starting <myservice> daemon: "
echo
daemon <myservice>
echo
;;
stop)
# Stop daemons.
echo -n $"Shutting down <myservice>: "
killproc <myservice>
echo
# Do clean-up works here like removing pid files from /var/run, etc.
;;
status)
status <myservice>
;;
restart)
$0 stop
$0 start
;;
*)
echo $"Usage: $0 {start|stop|status|restart}"
exit 1
esac
exit 0
Fonte original, aqui .