Weblog entry #4 for nicc777
This was rather interesting, but something I would like to add for us Debian admins is the start-stop-daemon(8).
With this little gem it is very easy to write your own startup scripts.
Here is my skeleton startup script:
#! /bin/sh
# /etc/init.d/jboss: start and stop the jboss daemon
SSD=/sbin/start-stop-daemon
ECHO=/bin/echo
TEST=/usr/bin/test
HOSTNAME=`/bin/hostname`
MYAPP=/path/to/app
MYAPPNAME=app
$TEST -x $MYAPP || exit 0
case "$1" in
start)
$ECHO -n "Starting $MYAPPNAME: $MYAPP"
$SSD -c myusername --start -b --quiet -p /var/run/app.pid -m --exec /path/to/app
$ECHO "."
;;
stop)
$ECHO -n "Stopping $MYAPPNAME: $MYAPP"
$SSD --stop -p /var/run/app.pid
$ECHO "."
;;
*)
$ECHO "Usage: /etc/init.d/$MYAPPNAME {start|stop)"
exit 1
esac
exit 0
Have fun.
Comments on this Entry
[ Parent | Reply to this comment ]
instead of /var/run/app.pid ?
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]