From 09b9e2ca76da3c97dc49ac4c3ff290228a0f4867 Mon Sep 17 00:00:00 2001 From: age Date: Tue, 31 Oct 2006 17:54:58 +0000 Subject: [PATCH] start-stop-daemon --- pythonrewrite/bin/cryptoboxd | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 pythonrewrite/bin/cryptoboxd diff --git a/pythonrewrite/bin/cryptoboxd b/pythonrewrite/bin/cryptoboxd new file mode 100755 index 0000000..f183e60 --- /dev/null +++ b/pythonrewrite/bin/cryptoboxd @@ -0,0 +1,34 @@ +#!/bin/sh + +CBXPATH="/home/age/svn/cryptobox/branches/pythonrewrite/bin/" +CBXSERVER="CryptoBoxWebserver.py" +DAEMON="/usr/bin/python2.4 ${CBXPATH}CryptoBoxWebserver.py" +NAME=cryptoboxd +DESC="CryptoBox Daemon (webinterface)" +RUNAS=age + +#test -x $DAEMON -a -f /etc/exports || exit 0 + +set -e + +case "$1" in + start) + echo -n "Starting $DESC: " + start-stop-daemon --background --chdir $CBXPATH --chuid $RUNAS --start --quiet --oknodo --exec $DAEMON \ + -- $DAEMON_OPTS + echo "$NAME." + ;; + + stop) + echo -n "Stopping $DESC: " + start-stop-daemon --stop --oknodo --exec $DAEMON + echo "$NAME." + ;; + *) + N=/etc/init.d/$NAME + echo "Usage: $N {start|stop}" >&2 + exit 1 + ;; +esac + +exit 0