You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How about a supervise flag file named 'killpg' that causes svc to default to sending a signal to the service process group by default? This would only be set for processes that do not clean up their children properly.
Initial patch below. This is largely inspired by the no-setsid change but it splits this feature off into its own flag, because they are orthogonal ideas.
--- a/supervise.8.in
+++ b/supervise.8.in
@@ -40,6 +40,12 @@ exists,
.B supervise
will run subordinate processes in a new process group.
+If the file
+.B ./killpg
+exists, all signals requested by the
+.BR svc (8)
+program will be sent to the process group instead of the process.
+
If
.B ./log
is an executable file,
diff --git a/supervise.c b/supervise.c
index a792f66..e4f21c8 100644
--- a/supervise.c
+++ b/supervise.c
@@ -326,6 +326,7 @@ void doit(void)
svc = &svcmain;
killpid = svc->pid;
+ if (stat_exists("killpg")==0) killpid = -killpid;
while (read(fdcontrol,&ch,1) == 1)
switch(ch) {
case '+':
@@ -340,6 +341,7 @@ void doit(void)
break;
case 'l':
svc = &svcmain;
+ if (stat_exists("killpg")==0) killpid = -killpid;
killpid = svc->pid;
break;
case 'd':
diff --git a/svc.8.in b/svc.8.in
index 8e2e2b6..582821e 100644
--- a/svc.8.in
+++ b/svc.8.in
@@ -25,7 +25,10 @@ process group. This is the default.
.TP
.B \-\+
Send all subsequent signals to the entire process group instead of just
-the parent process.
+the parent process. This is the default if the file
+.IB s/killpg
+is present.
+
.TP
.B \-L
Send all subsequent signals to the running
The text was updated successfully, but these errors were encountered:
How about a supervise flag file named 'killpg' that causes svc to default to sending a signal to the service process group by default? This would only be set for processes that do not clean up their children properly.
Initial patch below. This is largely inspired by the no-setsid change but it splits this feature off into its own flag, because they are orthogonal ideas.
The text was updated successfully, but these errors were encountered: