Skip to content

Instantly share code, notes, and snippets.

@bigpresh
Created January 19, 2011 12:09
Show Gist options
  • Save bigpresh/786080 to your computer and use it in GitHub Desktop.
Save bigpresh/786080 to your computer and use it in GitHub Desktop.
example init.d script for starting Dancer apps
[davidp@shakermaker:~]$ cat /etc/init.d/site-ijedomestics
#! /bin/sh
# Simple script for starting Dancer applications.
SITENAME=ijedomestics
PORT=5000
DIR=/websites/ijedomestics
SCRIPT=ijedomestics.pl
USER=davidp
PIDFILE=/var/run/site-$SITENAME.pid
case "$1" in
start)
start-stop-daemon --start --chuid $USER --chdir $DIR \
--pidfile=$PIDFILE \
--exec /usr/local/bin/starman -- -p $PORT $SCRIPT -D --pid $PIDFILE
;;
stop)
start-stop-daemon --stop --pidfile $PIDFILE
;;
*)
echo "Usage: $SCRIPTNAME {start|stop}" >&2
exit 3
;;
esac
:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment