diff options
author | Mikko Rantalainen <mikko.rantalainen@peda.net> | 2010-05-04 16:19:38 +0300 |
---|---|---|
committer | Mikko Rantalainen <mikko.rantalainen@peda.net> | 2010-05-06 11:30:22 +0300 |
commit | 9c31a14b268b4e7c42d7302d7b3830faacc0b45a (patch) | |
tree | f3ce3ee157c9150873ee9060787d9d761fa1c5f3 | |
parent | c2691887b0fc00e03ae56a320ca3269e7f4fd0fd (diff) | |
download | etherpad-9c31a14b268b4e7c42d7302d7b3830faacc0b45a.tar.gz etherpad-9c31a14b268b4e7c42d7302d7b3830faacc0b45a.tar.xz etherpad-9c31a14b268b4e7c42d7302d7b3830faacc0b45a.zip |
Fixed init.d/etherpad script for debian/ubuntu
For some reason that I cannot yet understand, there are two init.d
scripts with different content. The files are:
bin/etherpad.init.d
etherpad/bin/etherpad.init
I rewrote bin/etherpad.init.d to make start, stop and status functions
to work pretty much as intended. The status message currently says
"could not access PID file for etherpad" instead of "etherpad is not
running", when status is queried when etherpad is not running. This
needs to be fixed later.
This change has been tested with Ubuntu 9.10.
-rwxr-xr-x | bin/etherpad.init.d | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/bin/etherpad.init.d b/bin/etherpad.init.d index 5881b70..ef77fc6 100755 --- a/bin/etherpad.init.d +++ b/bin/etherpad.init.d @@ -2,13 +2,13 @@ ### BEGIN INIT INFO # Provides: etherpad -# Required-Start: $local_fs $remote_fs -# Required-Stop: $local_fs $remote_fs +# Required-Start: $networking $syslog +# Required-Stop: $networking $syslog # Default-Start: 2 3 4 5 # Default-Stop: S 0 1 6 # Short-Description: etherpad initscript -# Description: EtherPad is the only web-based word processor that allows -# people to work together in really real-time. +# Description: EtherPad is a web-based word processor that allows +# people to work together in real-time. # . # When multiple people edit the same document simultaneously, # any changes are instantly reflected on everyone's screen. @@ -18,6 +18,8 @@ ### END INIT INFO # Author: penSec.IT UG (haftungsbeschränkt) <mail@pensec.it> +# Author: Per Andersson <avtobiff@gmail.com> +# Author: Mikko Rantalainen <mikko.rantalainen@peda.net> ################################################################################ # @@ -42,8 +44,8 @@ # Do NOT "set -e" # PATH should only include /usr/* if it runs after the mountnfs.sh script -PATH=/usr/sbin:/usr/bin:/sbin:/bin -DESC="etherpad daemon" +PATH=/sbin:/usr/sbin:/bin:/usr/bin +DESC="Collaborative real-time editor" NAME="etherpad" DAEMON_BASE="/usr/share/etherpad" DAEMON=$DAEMON_BASE/bin/run.sh @@ -93,7 +95,7 @@ do_stop() # 1 if daemon was already stopped # 2 if daemon could not be stopped # other if a failure occurred - start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name java + start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE RETVAL="$?" [ "$RETVAL" = 2 ] && return 2 # Wait for children to finish too if this is a daemon that forks @@ -102,7 +104,7 @@ do_stop() # that waits for the process to drop all resources that could be # needed by services started subsequently. A last resort is to # sleep for some time. - start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec java + start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON [ "$?" = 2 ] && return 2 # Many daemons don't delete their pidfiles when they exit. rm -f $PIDFILE @@ -118,7 +120,7 @@ do_reload() { # restarting (for example, when it is sent a SIGHUP), # then implement that here. # - start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name java + start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE return 0 } @@ -139,6 +141,9 @@ case "$1" in 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; esac ;; + status) + status_of_proc -p $PIDFILE "$DAEMON" "$NAME" && exit 0 || exit $? + ;; #reload|force-reload) # # If do_reload() is not implemented then leave this commented out @@ -172,7 +177,7 @@ case "$1" in ;; *) #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 - echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 + echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2 exit 3 ;; esac |