Browse Source

Add KILL support to term-signal setting.

Also have renamed termsignal to term-signal for consistency, but the old
name remains supported.
Davin McCall 4 years ago
parent
commit
d8e8035081
4 changed files with 9 additions and 4 deletions
  1. 2 0
      NEWS
  2. 3 3
      doc/manpages/dinit-service.5
  3. 1 0
      src/dasynq/dasynq-select.h
  4. 3 1
      src/load-service.cc

+ 2 - 0
NEWS

@@ -7,6 +7,8 @@ preceding release.
  * Fix for crash due to SIGALRM on OpenBSD.
  * Fixes for compiling with Musl C library.
  * Fix dinitctl "enable" and "disable" commands when path to service directory is absolute.
+ * "termsignal" setting renamed "term-signal" and now supports "KILL" signal. "termsignal"
+   is still supported for compatibility with existing service descriptions.
  * Other minor fixes.
 
 == Version 0.5.0:

+ 3 - 3
doc/manpages/dinit-service.5

@@ -214,13 +214,13 @@ specified, the socket will be owned by the user id of the Dinit process.
 Specifies the group of the activation socket. See discussion of
 \fBsocket\-uid\fR.
 .TP
-\fBtermsignal\fR = {HUP | INT | QUIT | USR1 | USR2}
+\fBterm\-signal\fR = {HUP | INT | QUIT | USR1 | USR2 | KILL}
 Specifies an additional signal to send to the process when requesting it
 to terminate (applies to 'process' services only). SIGTERM is always
-sent along with the specified signal, unless the \fBnosigterm\fR option is
+sent along with the specified signal, unless the \fBno\-sigterm\fR option is
 specified via the \fBoptions\fR parameter.
 .TP
-\fBready-notification\fR = {\fBpipefd:\fR\fIfd-number\fR | \fBpipevar:\fR\fIenv-var-name\fR}
+\fBready\-notification\fR = {\fBpipefd:\fR\fIfd-number\fR | \fBpipevar:\fR\fIenv-var-name\fR}
 Specifies the mechanism, if any, by which a process service will notify that it is ready
 (successfully started). If not specified, a process service is considered started as soon as it
 has begun execution. The two options are:

+ 1 - 0
src/dasynq/dasynq-select.h

@@ -4,6 +4,7 @@
 #include <system_error>
 #include <vector>
 #include <atomic>
+#include <tuple>
 
 #include <sys/time.h>
 #include <sys/types.h>

+ 3 - 1
src/load-service.cc

@@ -30,6 +30,7 @@ static int signal_name_to_number(std::string &signame)
     if (signame == "QUIT") return SIGQUIT;
     if (signame == "USR1") return SIGUSR1;
     if (signame == "USR2") return SIGUSR2;
+    if (signame == "KILL") return SIGKILL;
     return -1;
 }
 
@@ -549,7 +550,8 @@ service_record * dirload_service_set::load_service(const char * name)
                     }
                 }
             }
-            else if (setting == "termsignal") {
+            else if (setting == "term-signal" || setting == "termsignal") {
+                // Note: "termsignal" supported for legacy reasons.
                 string signame = read_setting_value(i, end, nullptr);
                 int signo = signal_name_to_number(signame);
                 if (signo == -1) {