Subversion Repositories configs

Rev

Rev 4 | Go to most recent revision | 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
11
# pidfile: /var/run/zarafa-spooler.pid
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
45
pidfile=/var/run/$spooler.pid
46
 
47
start() {
48
	# Start in background, always succeeds
49
	echo -n $"Starting $spooler: "
50
	export LC_ALL=$ZARAFA_LOCALE
51
	export LANG=$ZARAFA_LOCALE
52
	daemon $SPOOLERPROGRAM $SPOOLERCONFIG_OPT
53
	RETVAL=$?
54
	unset LC_ALL LANG
55
	echo
56
	[ $RETVAL -eq 0 ] && touch $lockfile
57
 
58
	return $RETVAL
59
}
60
 
61
stop() {
62
	echo -n $"Stopping $spooler: "
63
	killproc $SPOOLERPROGRAM
64
	RETVAL=$?
65
	echo
66
	[ $RETVAL -eq 0 ] && rm -f $lockfile $pidfile
67
 
68
	return $RETVAL
69
}
70
 
71
restart() {
72
	stop
73
	start
74
}
75
 
76
reload() {
77
	echo -n $"Restarting $spooler: "
78
	killproc $SPOOLERPROGRAM -SIGHUP
79
	RETVAL=$?
80
	echo
81
 
82
	return $RETVAL
83
}
84
 
85
# See how we were called.
86
case "$1" in
87
    start)
88
		start
89
		;;
90
    stop)
91
		stop
92
		;;
93
    status)
94
		status $spooler
95
		RETVAL=$?
96
		;;
97
    restart|force-reload)
98
		restart
99
		;;
100
    condrestart|try-restart)
101
		if [ -f ${pidfile} ]; then
102
			stop
103
			start
104
		fi
105
		;;
106
    reload)
107
		reload
108
		;;
109
    *)
110
		echo $"Usage: $spooler {start|stop|status|reload|restart|condrestart|force-reload|try-restart}"
111
		RETVAL=1
112
		;;
113
esac
114
 
115
exit $RETVAL