7 # Sympa binaries directory
8 sympadir
="/srv/sympa/bin"
10 # Sympa config files directory
11 sympaconf
="/srv/sympa/etc/sympa.conf"
12 wwsympaconf
="/srv/sympa/etc/wwsympa.conf"
14 # Current state of the module
16 # First try "/u1/home/sympa/*.pid" files
17 if [ -f /srv
/sympa
/$1.pid
] ; then
18 pid
=`head -1 /srv/sympa/$1.pid`
19 if [ "$pid" != "" ] ; then
20 running
=`ps -A | sed 's/^ *//' | cut -d ' ' -f 1 | grep -x "$pid"`
21 if [ "$running" != "" ]; then
22 echo "$1 (pid $pid) is active..."
25 echo "$1 died, pid file remains."
35 sympa_module_start
() {
36 $sympadir/$1.pl
$startparam
40 # Test state of module before startup
42 sympa_status
$1 > /dev
/null
45 stat_busy
"Starting $1"
46 sympa_module_start
$1 && stat_done || stat_fail
49 stat_busy
"Starting $1, overwriting old pid file."
50 sympa_module_start
$1 && stat_done || stat_fail
54 echo "$1 seems active. No action will be taken."
55 echo "Try \"/etc/rc.d/sympa status\" or \"/etc/rc.d/sympa restart"\".
62 if [ -f /srv
/sympa
/$1.pid
]; then
63 stat_busy
"Stopping module $1.pl"
64 pid
=`head -1 /srv/sympa/$1.pid`
65 running
=`ps -A | sed 's/^ *//' | cut -d ' ' -f 1 | grep -x "$pid"`
66 if [ $1 == 'bulk' ]; then
67 kill -TERM $pid && stat_done || stat_fail
69 if [ "$running" != "" ]; then
70 kill -TERM $pid && stat_done || stat_fail
76 echo "Module $1.pl not running"
80 # See how we were called.
83 if [ ! -f /srv
/sympa
/var
/lock
/subsys
/sympa
]; then
84 echo "Starting Sympa subsystem: "
89 sympa_start task_manager
90 touch /srv
/sympa
/var
/lock
/subsys
/sympa
93 echo "Sympa seems active. No action will be taken."
94 echo "Try \"sympa status\" or \"sympa restart"\".
98 echo "Stopping Sympa subsystem: "
103 if [ -f /srv
/sympa
/sympa-distribute.pid
]; then
104 sympa_stop sympa-distribute
106 if [ -f /srv
/sympa
/sympa-creation.pid
]; then
107 sympa_stop sympa-creation
109 sympa_stop task_manager
110 if [ -f /srv
/sympa
/var
/lock
/subsys
/sympa
]; then
111 rm -f /srv
/sympa
/var
/lock
/subsys
/sympa
116 echo "Status of Sympa subsystem: "
117 if [ -f /srv
/sympa
/var
/lock
/subsys
/sympa
]; then
118 echo "Status file for subsystem found."
120 echo "Status file for subsystem NOT found."
124 sympa_status archived
126 sympa_status task_manager
129 echo "Restarting Sympa subsystem: "
136 echo "usage: $0 {start|stop|status|restart}"