Subversion Repositories configs

Rev

Rev 43 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
4 - 1
#!/bin/bash
2
#
3
# zarafa-spooler Zarafa Collaboration Server's Spooler Daemon
4
#
5
# chkconfig: 345 86 24
6
# description: The Zarafa Spooler is responsible for converting \
7
#              MAPI messages to the internet format and sending \
8
#              using your MTA as configured.
43 - 9
# processname: /usr/sbin/zarafa-spooler
4 - 10
# config: /etc/zarafa/spooler.cfg
59 - 11
# pidfile: /var/run/zarafad/spooler.pid
4 - 12
 
13
### BEGIN INIT INFO
14
# Provides: zarafa-spooler
15
# Required-Start: $local_fs $network $remote_fs $syslog
16
# Required-Stop: $local_fs $network $remote_fs $syslog
17
# Should-Start: zarafa-server
18
# Should-Stop: zarafa-server
19
# Short-Description: Zarafa Collaboration Server's Spooler Daemon
20
# Description: The Zarafa Spooler is responsible for converting
21
#              MAPI messages to the internet format and sending
22
#              using your MTA as configured.
23
### END INIT INFO
24
 
25
SPOOLERCONFIG=/etc/zarafa/spooler.cfg
43 - 26
SPOOLERPROGRAM=/usr/sbin/zarafa-spooler
4 - 27
 
28
# Sanity checks.
29
[ -x $SPOOLERPROGRAM ] || exit 0
30
 
31
SPOOLERCONFIG_OPT=""
32
[ ! -z $SPOOLERCONFIG -a -f $SPOOLERCONFIG ] && SPOOLERCONFIG_OPT="-c $SPOOLERCONFIG"
33
 
34
[ -f /etc/sysconfig/zarafa ] && . /etc/sysconfig/zarafa
35
if [ -z "$ZARAFA_LOCALE" ]; then
36
	ZARAFA_LOCALE="C"
37
fi
38
 
39
# Source function library.
40
. /etc/rc.d/init.d/functions
41
 
42
RETVAL=0
43
spooler=`basename $SPOOLERPROGRAM`
44
lockfile=/var/lock/subsys/$spooler
59 - 45
pidfile=/var/run/zarafad/spooler.pid
4 - 46
 
47
start() {
48
	# Start in background, always succeeds
49
	echo -n $"Starting $spooler: "
59 - 50
	install -dm0775 -o zarafa -g zarafa /var/run/zarafad
4 - 51
	export LC_ALL=$ZARAFA_LOCALE
52
	export LANG=$ZARAFA_LOCALE
53
	daemon $SPOOLERPROGRAM $SPOOLERCONFIG_OPT
54
	RETVAL=$?
55
	unset LC_ALL LANG
56
	echo
57
	[ $RETVAL -eq 0 ] && touch $lockfile
58
 
59
	return $RETVAL
60
}
61
 
62
stop() {
63
	echo -n $"Stopping $spooler: "
64
	killproc $SPOOLERPROGRAM
65
	RETVAL=$?
66
	echo
67
	[ $RETVAL -eq 0 ] && rm -f $lockfile $pidfile
68
 
69
	return $RETVAL
70
}
71
 
72
restart() {
73
	stop
74
	start
75
}
76
 
77
reload() {
78
	echo -n $"Restarting $spooler: "
79
	killproc $SPOOLERPROGRAM -SIGHUP
80
	RETVAL=$?
81
	echo
82
 
83
	return $RETVAL
84
}
85
 
86
# See how we were called.
87
case "$1" in
88
    start)
89
		start
90
		;;
91
    stop)
92
		stop
93
		;;
94
    status)
95
		status $spooler
96
		RETVAL=$?
97
		;;
98
    restart|force-reload)
99
		restart
100
		;;
101
    condrestart|try-restart)
102
		if [ -f ${pidfile} ]; then
103
			stop
104
			start
105
		fi
106
		;;
107
    reload)
108
		reload
109
		;;
110
    *)
111
		echo $"Usage: $spooler {start|stop|status|reload|restart|condrestart|force-reload|try-restart}"
112
		RETVAL=1
113
		;;
114
esac
115
 
116
exit $RETVAL