Monotone-Parent: b6518b59a7eb387bb26b065aa4b947048534a96a

Monotone-Revision: fadda581fd1abe4d86b55b0e83a0de4f42e41119

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2010-07-14T14:13:10
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2010-07-14 14:13:10 +00:00
parent 9afaff4af4
commit bed50b5b59

44
debian/sogo.init vendored
View File

@@ -46,40 +46,48 @@ if [ -f /etc/default/$NAME ]; then
. /etc/default/$NAME
fi
. /lib/lsb/init-functions
if [ ! -x $DAEMON ]; then
echo "$DAEMON is not executable."
log_failure_msg "$DAEMON is not executable."
exit 1
fi
# Ensure directory's existence and permissions
install -o sogo -g adm -m 755 -d /var/run/$NAME
install -o sogo -g adm -m 750 -d /var/spool/$NAME
install -o sogo -g adm -m 750 -d /var/log/$NAME
set -e
. /lib/lsb/init-functions
. /usr/share/GNUstep/Makefiles/GNUstep.sh
DAEMON_OPTS="-WOWorkersCount $PREFORK -WOPidFile $PIDFILE -WOLogFile $LOGFILE"
case "$1" in
start)
echo -n "Starting $DESC: "
start-stop-daemon -c $USER --start --quiet --pidfile $PIDFILE --exec $DAEMON -- $DAEMON_OPTS || true
echo "$NAME."
log_daemon_msg "Starting $DESC" "$NAME"
# Ensure directory's existence and permissions
install -o $USER -g adm -m 755 -d /var/run/$NAME
install -o $USER -g adm -m 750 -d /var/spool/$NAME
install -o $USER -g adm -m 750 -d /var/log/$NAME
if ! start-stop-daemon -c $USER --quiet --start --pidfile $PIDFILE --exec $DAEMON -- $DAEMON_OPTS
then
log_progress_msg "already running"
fi
log_end_msg 0
;;
stop)
echo -n "Stopping $DESC: "
start-stop-daemon --stop --quiet --pidfile $PIDFILE --exec $DAEMON || true
echo "$NAME."
log_daemon_msg "Stopping $DESC" "$NAME"
start-stop-daemon --stop --pidfile $PIDFILE --retry=TERM/20/KILL/5
log_end_msg 0
;;
restart)
echo -n "Restarting $DESC: "
start-stop-daemon --stop --quiet --pidfile $PIDFILE --exec $DAEMON || true
sleep 1
start-stop-daemon -c $USER --start --quiet --pidfile $PIDFILE --exec $DAEMON -- $DAEMON_OPTS || true
echo "$NAME."
log_daemon_msg "Restarting $DESC" "$NAME"
start-stop-daemon --stop --pidfile $PIDFILE --retry=TERM/20/KILL/5
# Ensure directory's existence and permissions
install -o sogo -g adm -m 755 -d /var/run/$NAME
install -o sogo -g adm -m 750 -d /var/spool/$NAME
install -o sogo -g adm -m 750 -d /var/log/$NAME
start-stop-daemon -c $USER --quiet --start --pidfile $PIDFILE --exec $DAEMON -- $DAEMON_OPTS
log_end_msg 0
;;
status)
status_of_proc -p $PIDFILE "$DAEMON" $NAME && exit 0 || exit $?