ports/mail/sympa/files/patch-src__etc__script__sympa.in
Chris Rees 2ea7ff1249 Fix rc script regex; should check for $pid followed by space or tab,
rather than space.  Also anchor.

Submitted by:	ivoras
2012-07-11 06:29:44 +00:00

38 lines
1.1 KiB
Text

--- src/etc/script/sympa.in.orig 2010-11-17 08:25:42.000000000 +0100
+++ src/etc/script/sympa.in 2012-04-20 12:35:40.000000000 +0200
@@ -2,6 +2,10 @@
#
# sympa Mailing Lists Management System
#
+# PROVIDE: sympa
+# REQUIRE: LOGIN cleanvar
+# KEYWORD: shutdown
+#
# Written by Michel Bouissou 20/07/2000
#
# Modified by Olivier Salaun 27/07/2000
@@ -159,7 +163,7 @@
if [ "$pids" != "" ]; then
for pid in $pids; do
killcount=0
- running=`ps -A | grep "$pid ..* $1\\.pl"`
+ running=`ps -A | grep "^[[:space:]]*$pid[[:space:]].*$1\\.pl"`
while [ "$running" != "" ]; do
if [ $killcount -gt 10 ]; then
if [ ${use_functions} ]; then
@@ -171,13 +175,13 @@
fi
kill -TERM $pid >/dev/null 2>&1
- running=`ps -A | grep "$pid ..* $1\\.pl"`
+ running=`ps -A | grep "^[[:space:]]*$pid[[:space:]].*$1\\.pl"`
if [ "$running" = "" ]; then
runcount=`expr $runcount + 1`
break
fi
sleep 2
- running=`ps -A | grep "$pid ..* $1\\.pl"`
+ running=`ps -A | grep "^[[:space:]]*$pid[[:space:]].*$1\\.pl"`
if [ "$running" = "" ]; then
runcount=`expr $runcount + 1`
break