ALT Linux Bugzilla
– Attachment 2163 Details for
Bug 7260
[FR] stop_daemon --timeout option
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
patch for --timeout option
functions.patch (text/plain), 1.38 KB, created by
enp
on 2007-08-24 12:57:19 MSD
(
hide
)
Description:
patch for --timeout option
Filename:
MIME Type:
Creator:
enp
Created:
2007-08-24 12:57:19 MSD
Size:
1.38 KB
patch
obsolete
>--- /etc/init.d/functions.orig 2007-08-24 12:34:35 +0400 >+++ /etc/init.d/functions 2007-08-24 12:34:24 +0400 >@@ -237,7 +237,7 @@ > > stop_daemon() > { >- local ANNOUNCE BASENAME CMDNAME DEFAULT DISPNAME EXPECT FLAGS HUPSIG LOCKFILE MESSAGE NAME PIDFILE SIGNAL STATUS WHICH >+ local ANNOUNCE BASENAME CMDNAME DEFAULT DISPNAME EXPECT FLAGS HUPSIG LOCKFILE MESSAGE NAME PIDFILE SIGNAL STATUS WHICH TIMEOUT > > # Process options. > ANNOUNCE=1 >@@ -248,6 +248,7 @@ > LOCKFILE= > NAME= > PIDFILE= >+ TIMEOUT=1 > # start-stop-daemon wants a signal number. > SIGNAL="$(kill -l TERM)" || SIGNAL=15 > HUPSIG="$(kill -l HUP)" || HUPSIG=1 >@@ -292,6 +293,11 @@ > PIDFILE="$1" > shift > ;; >+ --timeout) >+ shift >+ TIMEOUT="$1" >+ shift >+ ;; > -[0-9]*) > SIGNAL="${1##-}" > DEFAULT=false >@@ -372,11 +378,19 @@ > # custom signal. > if [ "$DEFAULT" = true -a $STATUS -eq 0 ]; then > usleep 100000 >- if start-stop-daemon $FLAGS --test > /dev/null; then >- sleep 1 >- SIGNAL="$(kill -l KILL)" || SIGNAL=9 >- start-stop-daemon $FLAGS --signal "$SIGNAL" > /dev/null >- fi >+ for ((i=1; i <= TIMEOUT ; i++)) >+ do >+ if start-stop-daemon $FLAGS --test > /dev/null; then >+ sleep 1 >+ if [ $i == $TIMEOUT ]; then >+ SIGNAL="$(kill -l KILL)" || SIGNAL=9 >+ start-stop-daemon $FLAGS --signal "$SIGNAL" > /dev/null >+ fi >+ else >+ break >+ fi >+ >+ done > [ -z "$PIDFILE" ] || rm -f "$PIDFILE" > fi >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 7260
: 2163