Dr. Werner Fink 2010-04-12 15:50:47 +00:00 committed by Git OBS Bridge
parent 5e0aaf7db5
commit 4228bd3e98
2 changed files with 56 additions and 4 deletions

View File

@ -56,9 +56,47 @@
if (pidof(fullname,root,flags) < 0)
exit(LSB_STATUS_PROOFX);
}
--- killproc.8
+++ killproc.8 2010-04-12 15:49:09.610924538 +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
+.B killproc
+does 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 ).
--- killproc.c
+++ killproc.c 2009-12-07 15:36:39.299430484 +0000
@@ -135,7 +135,6 @@ int main(int argc, char **argv)
+++ killproc.c 2010-04-12 15:43:46.802925071 +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);
boolean pid_forced = false;
+ boolean sig_forced = true;
we_are = base_name(argv[0]);
openlog (we_are, LOG_OPTIONS, LOG_FACILITY);
@@ -79,11 +80,13 @@ int main(int argc, char **argv)
memset(sig, 0, len);
*sig = 'q'; /* set dummy option -q */
snum = tmp;
+ sig_forced = false;
break;
} else if ( (tmp = signame_to_signum(sig)) > 0 ) {
memset(sig, 0, len);
*sig = 'q'; /* set dummy option -q */
snum = tmp;
+ sig_forced = false;
break;
}
}
@@ -135,7 +138,6 @@ int main(int argc, char **argv)
/* Allocate here: address optarg (current *argv) isn't freeable */
if (optarg && !pid_file) {
pid_file = xstrdup(optarg);
@ -66,7 +104,7 @@
} else
error(LSB_WRGSYN,"Option -p requires pid file to read pid from\n");
break;
@@ -195,7 +194,8 @@ int main(int argc, char **argv)
@@ -195,7 +197,8 @@ int main(int argc, char **argv)
pid_file = (char*) xmalloc(DEFPIDLEN+strlen(basename)+1);
pid_file = strcat(strcat(strcpy(pid_file,DEFPIDDIR),basename),DEFPIDEXT);
}
@ -76,7 +114,7 @@
/* Check and verify the pid file */
errno = 0;
@@ -215,17 +215,22 @@ int main(int argc, char **argv)
@@ -215,17 +218,22 @@ int main(int argc, char **argv)
if (!remember)
exit(LSB_NOPROC); /* New LSB: no pid file is no job */
}
@ -101,6 +139,15 @@
}
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);
- 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()
--- 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,8 @@
-------------------------------------------------------------------
Mon Apr 12 17:49:46 CEST 2010 - werner@suse.de
- Be LSB compliant wih killproc (bnc#595796, bnc#578246)
-------------------------------------------------------------------
Fri Apr 9 15:45:51 CEST 2010 - werner@suse.de