Skip to content

Instantly share code, notes, and snippets.

@svenvarkel
Created September 23, 2013 07:31
Show Gist options
  • Save svenvarkel/6667444 to your computer and use it in GitHub Desktop.
Save svenvarkel/6667444 to your computer and use it in GitHub Desktop.
CONFLUENCE init script for Debian
#!/bin/sh
### BEGIN INIT INFO
# Provides: confluence
# Required-Start: $local_fs $remote_fs $network $syslog nginx
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts confluence server
# Description: starts confluence using start-stop-daemon
### END INIT INFO
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMONSTART=/usr/local/lib/confluence/bin/startup.sh
DAEMONSTOP=/usr/local/lib/confluence/bin/shutdown.sh
NAME=confluence
DESC=confluence
DAEMONUSER=confluence
PIDFILE=/usr/local/lib/confluence/work/catalina.pid
test -x $DAEMONSTART || exit 0
test -x $DAEMONSTOP || exit 0
set -e
. /lib/lsb/init-functions
case "$1" in
start)
echo -n "Starting $DESC: "
start-stop-daemon --start --pidfile $PIDFILE \
--chuid $DAEMONUSER --exec $DAEMONSTART -- $DAEMON_OPTS || true
echo "$NAME."
;;
stop)
echo -n "Stopping $DESC: "
start-stop-daemon --stop --pidfile $PIDFILE || true
echo "$NAME."
;;
*)
echo "Usage: $NAME {start|stop}" >&2
exit 1
;;
esac
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment