summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2024-10-04 11:47:42 +0000
committerLaurent Bercot <ska@appnovation.com>2024-10-04 11:47:42 +0000
commitde8c2721d5652e498cfab99857f989c379b72db2 (patch)
treee38ce3301343d46e79a05779c51e4bbac9bdaefd
parent6c9eabd7360a7c6c5f25b02b19352f1ec078d5d2 (diff)
downloads6-de8c2721d5652e498cfab99857f989c379b72db2.tar.xz
Prepare for 2.13.1.0; add flag-newpidns
Signed-off-by: Laurent Bercot <ska@appnovation.com>
-rw-r--r--NEWS4
-rw-r--r--doc/index.html2
-rw-r--r--doc/upgrade.html2
-rw-r--r--package/info2
-rw-r--r--src/supervision/s6-supervise.c11
5 files changed, 16 insertions, 5 deletions
diff --git a/NEWS b/NEWS
index 3727420..d9c6748 100644
--- a/NEWS
+++ b/NEWS
@@ -1,10 +1,12 @@
Changelog for s6.
-In 2.13.0.1
+In 2.13.1.0
-----------
- Bugfixes.
- Install static libraries in /usr/lib by default.
+ - Support for starting the service in a new pid namespace, via the
+flag-newpidns file in the service directory. (Linux only.)
In 2.13.0.0
diff --git a/doc/index.html b/doc/index.html
index 4dc2771..1d46de0 100644
--- a/doc/index.html
+++ b/doc/index.html
@@ -115,7 +115,7 @@ want nsswitch-like functionality:
<h3> Download </h3>
<ul>
- <li> The current released version of s6 is <a href="s6-2.13.0.1.tar.gz">2.13.0.1</a>. </li>
+ <li> The current released version of s6 is <a href="s6-2.13.1.0.tar.gz">2.13.1.0</a>. </li>
<li> Alternatively, you can checkout a copy of the
<a href="//git.skarnet.org/cgi-bin/cgit.cgi/s6/">s6
git repository</a>:
diff --git a/doc/upgrade.html b/doc/upgrade.html
index d675f5d..4bbed78 100644
--- a/doc/upgrade.html
+++ b/doc/upgrade.html
@@ -18,7 +18,7 @@
<h1> What has changed in s6 </h1>
-<h2> in 2.13.0.1 </h2>
+<h2> in 2.13.1.0 </h2>
<ul>
<li> <a href="//skarnet.org/software/skalibs/">skalibs</a>
diff --git a/package/info b/package/info
index 19f60ab..e39a538 100644
--- a/package/info
+++ b/package/info
@@ -1,4 +1,4 @@
package=s6
-version=2.13.0.1
+version=2.13.1.0
category=admin
package_macro_name=S6
diff --git a/src/supervision/s6-supervise.c b/src/supervision/s6-supervise.c
index deed9e5..9f56c47 100644
--- a/src/supervision/s6-supervise.c
+++ b/src/supervision/s6-supervise.c
@@ -95,6 +95,13 @@ static inline void announce (void)
strerr_warnwu1sys("write status file") ;
}
+static int check_file (char const *file)
+{
+ if (access(file, F_OK) == 0) return 1 ;
+ if (errno != ENOENT) strerr_warnwu2sys("access ", file) ;
+ return 0 ;
+}
+
static int read_file (char const *file, char *buf, size_t n)
{
ssize_t r = openreadnclose_nb(file, buf, n) ;
@@ -295,6 +302,7 @@ static void trystart (void)
size_t orig = 5 ;
int notifyp[2] = { -1, -1 } ;
unsigned int lk = 0, notif = 0 ;
+ uint16_t cspawnflags = CSPAWN_FLAGS_SELFPIPE_FINISH | CSPAWN_FLAGS_SETSID ;
if (read_uint("lock-fd", &lk))
{
@@ -358,7 +366,8 @@ static void trystart (void)
fa[1].x.fd2[1] = notifyp[1] ;
}
- status.pid = cspawn(cargv[orig], cargv + orig, (char const *const *)environ, CSPAWN_FLAGS_SELFPIPE_FINISH | CSPAWN_FLAGS_SETSID, fa, notifyp[1] >= 0 ? 2 : 0) ;
+ if (check_file("flag-newpidns")) cspawnflags |= CSPAWN_FLAGS_NEWPIDNS ;
+ status.pid = cspawn(cargv[orig], cargv + orig, (char const *const *)environ, cspawnflags, fa, notifyp[1] >= 0 ? 2 : 0) ;
if (!status.pid)
{
settimeout(60) ;