File: cyrus-imspd.init

package info (click to toggle)
cyrus-imspd 1.8-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch, wheezy
  • size: 3,448 kB
  • sloc: ansic: 15,708; sh: 2,200; makefile: 188
file content (58 lines) | stat: -rw-r--r-- 1,318 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/sh
#
### BEGIN INIT INFO
# Provides:          cyrus-imspd
# Required-Start:    $remote_fs $network
# Required-Stop:     $remote_fs
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Internet Message Support Protocol daemon
# Description:       Internet Message Support Protocol (imsp) daemon, providing
#                    central storage for addressbooks and application config.
### END INIT INFO

set -e

DAEMON=/usr/sbin/cyrus-imspd
PATH=/sbin:/bin:/usr/sbin:/usr/bin

# Has the package been 'removed' but not purged?
test -f $DAEMON || exit 0

. /lib/lsb/init-functions

# Source the config file
DEFAULT=/etc/default/cyrus-imspd
[ -f $DEFAULT ] && . $DEFAULT

ARGS="--exec $DAEMON --pidfile=/var/run/cyrus-imspd.pid --make-pidfile"
[ "$IMSP_USER" ] && ARGS="$ARGS --chuid $IMSP_USER"
[ "$IMSP_GROUP" ] && ARGS="$ARGS --group $IMSP_GROUP"

case "$1" in
    start)
	log_daemon_msg "Starting cyrus-imspd"
	start-stop-daemon $ARGS --start --background --oknodo -- $IMSP_ARGS
	log_end_msg 0
	;;

    stop)
	log_daemon_msg "Stopping cyrus-imspd"
	start-stop-daemon $ARGS --stop --oknodo
	rm -f /var/run/cyrus-imspd.pid
	log_end_msg 0
	;;

    restart|force-reload)
	$0 stop
	sleep 1
	$0 start
	;;

    *)
	echo "Usage: $0 {start|stop|restart|force-reload}" >&2
	exit 1
	;;
esac

exit 0