diff options
author | Felix Richter <github@syntax-fehler.de> | 2011-06-30 23:06:27 +0200 |
---|---|---|
committer | Felix Richter <github@syntax-fehler.de> | 2011-06-30 23:06:27 +0200 |
commit | f35d129de5003cb46c81a8691ed94285ce467606 (patch) | |
tree | 085f1dd5fe8ee6de44c878690085a3d2243abc38 /evan/evan-startup | |
parent | 3aa54ea3040e2a52099f8496ab255982caa88f51 (diff) | |
parent | ad89350b16a31d6bd6a644ad162d8723e85945ee (diff) |
Merge branch 'master' of github.com:krebscode/painload
Diffstat (limited to 'evan/evan-startup')
-rwxr-xr-x | evan/evan-startup | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/evan/evan-startup b/evan/evan-startup new file mode 100755 index 00000000..8a7f8daa --- /dev/null +++ b/evan/evan-startup @@ -0,0 +1,74 @@ +#! /bin/sh +# +### BEGIN INIT INFO +# Provides: evan +# Required-Start: $remote_fs $network +# Required-Stop: $remote_fs $network +# Should-Start: $syslog $named +# Should-Stop: $syslog +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Start evan daemons +# Description: + +### END INIT INFO +# +# Based on Lubomir Bulej's Redhat init script. + +DAEMON="/root/bin/evan" +PIDFILE="/var/lock/evan" +NAME="evan" +DESC="evan daemons" +TCONF="/etc/evan" + +test -f $DAEMON || exit 0 + +[ -r /etc/default/evan ] && . /etc/default/evan + + +start() { + [ -e $PIDFILE ] && echo "$PIDFILE already exists" && return + $DAEMON $EXTRA -d "$@" & + echo $(($$+1)) > $PIDFILE #TODO fix this ugly hack! +} +stop() { + [ ! -e $PIDFILE ] && echo "$PIDFILE does not exist" && return + kill `cat $PIDFILE` + #killall evan + rm $PIDFILE +} + +reload() { + echo "do nothing" + # do nothing +} + +restart() { + stop "$@" + start "$@" +} + +case "$1" in + start) + echo -n "Starting $DESC:" + start + ;; + stop) + echo -n "Stopping $DESC:" + stop + ;; + reload|force-reload) + echo -n "Reloading $DESC configuration:" + reload + ;; + restart) + echo -n "Restarting $DESC:" + restart + ;; + *) + echo "Usage: /etc/init.d/$NAME {start|stop|reload|restart|force-reload}" + exit 1 + ;; +esac +echo "done" +exit 0 |