123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- $OpenBSD: patch-src_etc_script_sympa_in,v 1.4 2016/11/04 10:22:26 landry Exp $
- --- src/etc/script/sympa.in.orig Wed Jun 10 18:24:26 2015
- +++ src/etc/script/sympa.in Thu Nov 3 17:10:49 2016
- @@ -90,7 +51,7 @@ sympa_status() {
- if [ -f ${sympapiddir}/$1.pid ] ; then
- pid=`head -1 ${sympapiddir}/$1.pid | tr -s ' ' '|'`
- if [ "$pid" != "" ] ; then
- - running=`ps -A | egrep "$pid"`
- + running=`pgrep -f $1.pl`
- if [ "$running" != "" ]; then
- echo "$1 (pid(s) $pid) is active..."
- return 0
- @@ -188,7 +137,7 @@ sympa_stop() {
- if [ "$pids" != "" ]; then
- for pid in $pids; do
- killcount=0
- - running=`ps -A | grep "$pid ..* $comm"`
- + running=`pgrep -f $1.pl`
- while [ "$running" != "" ]; do
- if [ $killcount -gt 10 ]; then
- if [ ${use_functions} ]; then
- @@ -200,13 +149,13 @@ sympa_stop() {
- fi
-
- kill -TERM $pid >/dev/null 2>&1
- - running=`ps -A | grep "$pid ..* $comm"`
- + running=`pgrep -f $1.pl`
- if [ "$running" = "" ]; then
- runcount=`expr $runcount + 1`
- break
- fi
- sleep 2
- - running=`ps -A | grep "$pid ..* $comm"`
- + running=`pgrep -f $1.pl`
- if [ "$running" = "" ]; then
- runcount=`expr $runcount + 1`
- break
- @@ -232,14 +176,6 @@ sympa_stop() {
- }
-
-
- -# Check that networking is up.
- -if [ ${OSTYPE} != "Slack" -a ${OSTYPE} != "FreeBSD" -a ${OSTYPE} != "SunOS" -a ${OSTYPE} != "darwin7.0" -a ${OSTYPE} != "Debian" -a ${OSTYPE} != "Suse" ]; then
- - if [ ${NETWORKING} = "no" ]
- - then
- - exit 0
- - fi
- -fi
- -
- # Check config files
- [ -d $sympadir ] || exit 0
- [ -f $sympaconf ] || exit 0
- @@ -297,11 +233,13 @@ case "$1" in
- else
- echo "Status file for subsystem NOT found."
- fi
- - sympa_status sympa_msg
- - sympa_status bulk
- - sympa_status archived
- - sympa_status bounced
- - sympa_status task_manager
- + failed=0
- + sympa_status sympa_msg || failed=1
- + sympa_status bulk || failed=1
- + sympa_status archived || failed=1
- + sympa_status bounced || failed=1
- + sympa_status task_manager || failed=1
- + if [ $failed == 1 ] ; then exit 1 ; fi
- ;;
- restart)
- echo "Restarting Sympa subsystem: "
|