This repository has been archived by the owner on Aug 23, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
sympa-sympasoap.init
94 lines (83 loc) · 1.81 KB
/
sympa-sympasoap.init
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#!/bin/sh
#
# sympasoap Sympa SOAP Interface
#
# Written by IKEDA Soji 2017-07-19
#
# chkconfig: - 95 05
# description: sympa is a powerful mailing lists management system.
# processname: nginx
# config: /etc/sympa/sympa.conf
# config: /etc/sysconfig/sympa
# pidfile: /var/run/sympa/sympasoap.pid
if [ -f /etc/rc.d/init.d/functions ]; then
. /etc/rc.d/init.d/functions
fi
FCGI_CHILDREN=5
FCGI_USER=sympa
FCGI_GROUP=sympa
FCGI_PID_DIR=/var/run/sympa
FCGI_OPTS='-M 0600 -U nginx'
if [ -e /etc/sysconfig/sympa ]; then
. /etc/sysconfig/sympa
fi
prog=sympasoap
pidfile="${FCGI_PID_DIR}/${prog}.pid"
lockfile="/var/lock/subsys/${prog}"
socketfile="${FCGI_PID_DIR}/${prog}.socket"
fcgiapp="/usr/libexec/sympa/sympa_soap_server.fcgi"
sympaconf="/etc/sympa/sympa.conf"
start() {
[ -x $fcgiapp ] || exit 5
[ -f $sympaconf ] || exit 6
echo -n $"Starting $prog: "
daemon /usr/bin/spawn-fcgi \
-F ${FCGI_CHILDREN} -P $pidfile -s $socketfile \
-u ${FCGI_USER} -g ${FCGI_GROUP} ${FCGI_OPTS} -- \
$fcgiapp
retval=$?
echo
[ $retval -eq 0 ] && touch $lockfile
return $retval
}
stop() {
echo -n $"Stopping $prog: "
killproc -p $pidfile $(basename $fcgiapp)
retval=$?
echo
[ $retval -eq 0 ] && rm -f $lockfile
return $retval
}
restart() {
stop
start
}
rh_status() {
status $(basename $fcgiapp)
}
rh_status_q() {
rh_status >/dev/null 2>&1
}
case "$1" in
start)
rh_status_q && exit 0
$1
;;
stop)
rh_status_q || exit 0
$1
;;
restart)
$1
;;
status)
rh_$1
;;
condrestart|try-restart)
rh_status_q || exit 7
restart
;;
*)
echo $"Usage: $0 {start|stop|status|restart}"
exit 2
esac