summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2020-02-18 12:25:29 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2020-02-18 12:25:29 +0000
commit173d58a10c40f1fd64034690eab82833d4a4770d (patch)
tree7200c4d15d9e4ffc74598554100fdb503050939c
parent4ad28c83818e3b7b351ac328e3753d8dab8b2804 (diff)
downloads6-173d58a10c40f1fd64034690eab82833d4a4770d.tar.xz
Add SIGPWR and SIGWINCH support to s6-svscan
-rw-r--r--NEWS2
-rw-r--r--doc/s6-svscan.html2
-rw-r--r--doc/upgrade.html2
-rw-r--r--src/supervision/s6-svscan.c8
4 files changed, 14 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index cedcd29..0cf76c4 100644
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,8 @@ In 2.9.1.0
when execline support is disabled.
- New '?' directive to s6-log, to spawn a processor with /bin/sh.
- New console holder functionality for easier s6-svscan-log support.
+ - On systems that define SIGPWR and SIGWINCH, s6-svscan -s now calls
+a user handler for those signals.
In 2.9.0.1
diff --git a/doc/s6-svscan.html b/doc/s6-svscan.html
index b826847..fc54cd9 100644
--- a/doc/s6-svscan.html
+++ b/doc/s6-svscan.html
@@ -135,6 +135,8 @@ it receives one of the following signals.
<li> SIGINT&nbsp;: fork and execute <tt>.s6-svscan/SIGINT</tt> </li>
<li> SIGUSR1&nbsp;: fork and execute <tt>.s6-svscan/SIGUSR1</tt> </li>
<li> SIGUSR2&nbsp;: fork and execute <tt>.s6-svscan/SIGUSR2</tt> </li>
+ <li> SIGPWR (on systems that define it)&nbsp;: fork and execute <tt>.s6-svscan/SIGPWR</tt> </li>
+ <li> SIGWINCH (on systems that define it)&nbsp;: fork and execute <tt>.s6-svscan/SIGWINCH</tt> </li>
</ul>
<p>
diff --git a/doc/upgrade.html b/doc/upgrade.html
index 72b5386..636a03c 100644
--- a/doc/upgrade.html
+++ b/doc/upgrade.html
@@ -35,6 +35,8 @@ interpreter. </li>
<li> A new <tt>-X</tt> option has been added to <a href="s6-svscan.html>s6-svscan</a>
to better support <a href="//skarnet.org/software/s6-linux-init/">s6-linux-init</a>
installations. </li>
+ <li> <a href="s6-svscan.html>s6-svscan</a> now handles SIGPWR and SIGWINCH, when
+diverted, on systems that define those signals. </li>
</ul>
<h2> in 2.9.0.1 </h2>
diff --git a/src/supervision/s6-svscan.c b/src/supervision/s6-svscan.c
index 800fc9f..bf338d5 100644
--- a/src/supervision/s6-svscan.c
+++ b/src/supervision/s6-svscan.c
@@ -7,6 +7,7 @@
#include <errno.h>
#include <fcntl.h>
#include <signal.h>
+
#include <skalibs/allreadwrite.h>
#include <skalibs/sgetopt.h>
#include <skalibs/types.h>
@@ -18,6 +19,7 @@
#include <skalibs/sig.h>
#include <skalibs/selfpipe.h>
#include <skalibs/environ.h>
+
#include <s6/config.h>
#include <s6/s6-supervise.h>
@@ -528,6 +530,12 @@ int main (int argc, char const *const *argv)
{
sigaddset(&set, SIGUSR1) ;
sigaddset(&set, SIGUSR2) ;
+#ifdef SIGPWR
+ sigaddset(&set, SIGPWR) ;
+#endif
+#ifdef SIGWINCH
+ sigaddset(&set, SIGWINCH) ;
+#endif
}
if (selfpipe_trapset(&set) < 0) strerr_diefu1sys(111, "trap signals") ;
}