Dr. Werner Fink 2010-07-20 09:48:27 +00:00 committed by Git OBS Bridge
parent ae84e6d151
commit 8af8b9b968
2 changed files with 66 additions and 12 deletions

View File

@ -57,23 +57,66 @@
exit(LSB_STATUS_PROOFX);
}
--- killproc.8
+++ killproc.8 2010-04-12 15:49:09.610924538 +0000
+++ killproc.8 2010-07-20 09:30:00.775424897 +0000
@@ -57,9 +57,11 @@ is sent. If this program is not called w
.B killproc
then
.B SIGHUP
-is used. Note that if
+is used. Note that if no signal is specified and the program
+is used. Note that if no signal is specified on the command line and the program
+.B killproc
+does not terminate a process with the default
+can not terminate a process with the default
.B SIGTERM
-is used and does not terminate a process the signal
+the signal
.B SIGKILL
is send after a few seconds (default is 5 seconds, see option
.BR \-t ).
@@ -240,16 +242,21 @@ or by number
.B \-t\fI<sec>\fP
The number
.I <sec>
-specifies the seconds to wait between the sent signal
+specifies the seconds to wait between the default signal
.B SIGTERM
and the subsequentially signal
.B SIGKILL
if the first
.B SIGTERM
does not show any result within the
-first few milli seconds. This defaults to
+first few milli seconds. This timeout defaults to
.B 5
-seconds.
+seconds. On the other hand if the signal
+.B SIGTERM
+was explicitly used on the command line, the signal
+.B SIGKILL
+will be omitted, even if the process was not terminated
+after the timeout has expired.
.TP
.B \-q
This option is ignored.
@@ -278,7 +285,7 @@ then the pid from this file is being use
terminate the sendmail process. Other running processes are
ignored.
.TP
-.B killproc -p /var/myrun/lpd.pid -TERM /usr/sbin/lpd
+.B killproc -p /var/myrun/lpd.pid /usr/sbin/lpd
.IP
sends the signal
.B SIGTERM
@@ -293,7 +300,7 @@ does not exist,
assumes that the daemon of
.B /usr/sbin/lpd
is not running. The exit status
-is set to 0 for successfully delivering the given signals
+is set to 0 for successfully delivering the default signals
.BR SIGTERM " and " SIGKILL
otherwise to 7 if the program was not running. It is also
successful if
--- killproc.c
+++ killproc.c 2010-04-12 15:43:46.802925071 +0000
+++ killproc.c 2010-07-20 09:35:09.234925068 +0000
@@ -48,6 +48,7 @@ int main(int argc, char **argv)
int process_group = 0, group_leader = 0, wait = 5, iargc = 0;
unsigned short flags = (KILL|PIDOF|KSTOP);
@ -139,15 +182,18 @@
}
if (pid_file) { /* The case of having a pid file */
@@ -269,7 +277,7 @@ int main(int argc, char **argv)
for(list = remember; list; list = list->next)
do_kill(basename, list->pid, snum, group_leader, process_group);
@@ -291,7 +299,10 @@ again:
goto again;
}
- if (snum == SIGTERM || snum == SIGKILL) {
+ if ((sig_forced && snum == SIGTERM) || snum == SIGKILL) {
int partsec = 5*wait; /* We look 5 times within a second */
/*
* Does anybody have a better idea ... something with sigaction()/signal()
- if (snum == SIGKILL)
+ if (snum == SIGKILL) /* SIGKILL was specified on the command line */
+ goto badterm;
+
+ if (!sig_forced) /* SIGTERM was specified on the command line */
goto badterm;
if (check_pids(fullname,root,flags) < 0)
--- libinit.c
+++ libinit.c 2009-10-28 09:47:13.711429753 +0000
@@ -320,13 +320,15 @@ static ssize_t xread(int fd, void *inbuf

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Tue Jul 20 11:43:58 CEST 2010 - werner@suse.de
- Enforce killproc to wait even if the SIGTERM has been specified
on the command line. This should avoid the in most cases that
the daemon has not finished its response on SIGTERM, see bug
bnc#623460 and bug bnc#595796.
-------------------------------------------------------------------
Fri Jul 16 17:22:27 CEST 2010 - werner@suse.de