3 # Provides: citadel-server
4 # Required-Start: $local_fs $remote_fs
5 # Required-Stop: $local_fs $remote_fs
6 # Default-Start: 2 3 4 5
8 # Short-Description: control citadel server start at boot time
9 # Description: control citadel server start at boot time
12 # Author: Wilfried Goesgens <citadel@outgesourced.org>
13 RUNDIR=/var/run/citadel
14 PATH=/sbin:/usr/sbin:/bin:/usr/bin
15 DESC="Citadel Groupware "
17 DAEMON=/usr/sbin/$NAME
18 DAEMON_ARGS=" -d -x3 -lmail -t/dev/null"
19 PIDFILE=$RUNDIR/$NAME.pid
20 SCRIPTNAME=/etc/init.d/citadel
21 SENDCOMMAND=/usr/sbin/sendcommand
24 # Exit if the package is not installed
25 [ -x "$DAEMON" ] || exit 0
27 # Read configuration variable file if it is present
28 [ -r /etc/default/$NAME ] && . /etc/default/$NAME
30 # check if we 've got a newer system, so we can do fancy colors and so on.
33 # Load the VERBOSE setting and other rcS variables
34 if test -f /lib/init/vars.sh ; then
38 # Define LSB log_* functions.
39 # Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
40 if test -f /lib/lsb/init-functions; then
41 . /lib/lsb/init-functions
46 # Function that starts the daemon/service
50 # for ubuntu: check our volatile dirs.
51 if test ! -d $RUNDIR; then
55 # 0 if daemon has been started
56 # 1 if daemon was already running
57 # 2 if daemon could not be started
67 # Function that stops the daemon/service
72 # 0 if daemon has been stopped
73 # 1 if daemon was already stopped
74 # 2 if daemon could not be stopped
75 # other if a failure occurred
76 if $SENDCOMMAND "DOWN" >/dev/null 2>&1 ; then
79 while test -S /var/run/citadel/citadel.socket; do
92 # Function that sends a SIGHUP to the daemon/service
102 if test -n "$MODERN"; then
103 [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
105 echo "Starting $DESC" "$NAME"
109 if test -n "$MODERN"; then
111 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
112 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
117 if test -n "$MODERN"; then
118 [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
120 echo "Stopping $DESC" "$NAME"
123 if test -n "$MODERN"; then
125 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
126 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
130 restart|force-reload)
131 if test -n "$MODERN"; then
132 log_daemon_msg "Restarting $DESC" "$NAME"
134 echo "Restarting $DESC" "$NAME"
139 if test -n "$MODERN"; then
145 1) log_end_msg 1 ;; # Old process is still running
146 *) log_end_msg 1 ;; # Failed to start
159 echo "Usage: $SCRIPTNAME {start|stop|restart}" >&2