aboutsummaryrefslogtreecommitdiffstats
path: root/bin/etherpad.init.d
diff options
context:
space:
mode:
Diffstat (limited to 'bin/etherpad.init.d')
-rwxr-xr-xbin/etherpad.init.d25
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