commit 80d231165357cf0d57b23dfe3b0aa16c7cb79545
parent ae972753206764373d4bce367e642eb31f0df68c
Author: Laurent Bercot <ska-skaware@skarnet.org>
Date: Tue, 31 Jan 2023 12:06:01 +0000
Prepare for 2.11.2.1, move template location, change file list
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat:
9 files changed, 41 insertions(+), 14 deletions(-)
diff --git a/INSTALL b/INSTALL
@@ -6,7 +6,7 @@ Build Instructions
- A POSIX-compliant C development environment
- GNU make version 3.81 or later
- - skalibs version 2.13.0.0 or later: https://skarnet.org/software/skalibs/
+ - skalibs version 2.13.1.0 or later: https://skarnet.org/software/skalibs/
- execline version 2.9.1.0 or later: https://skarnet.org/software/execline/
(You can disable this requirement at configure time, but will
lose some functionality.)
diff --git a/NEWS b/NEWS
@@ -1,5 +1,12 @@
Changelog for s6.
+In 2.11.2.1
+-----------
+
+ - Bugfixes.
+ - Internal changes to instances and servicedir reserved names.
+
+
In 2.11.2.0
-----------
diff --git a/doc/index.html b/doc/index.html
@@ -83,7 +83,7 @@ with s6</a> </li>
<li> A POSIX-compliant system with a standard C development environment </li>
<li> GNU make, version 3.81 or later </li>
<li> <a href="//skarnet.org/software/skalibs/">skalibs</a> version
-2.13.0.0 or later. It's a build-time requirement. It's also a run-time
+2.13.1.0 or later. It's a build-time requirement. It's also a run-time
requirement if you link against the shared version of the skalibs
library. </li>
<li> (Optional, but really recommended for full functionality):
@@ -115,7 +115,7 @@ want nsswitch-like functionality:
<h3> Download </h3>
<ul>
- <li> The current released version of s6 is <a href="s6-2.11.2.0.tar.gz">2.11.2.0</a>. </li>
+ <li> The current released version of s6 is <a href="s6-2.11.2.1.tar.gz">2.11.2.1</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/instances.html b/doc/instances.html
@@ -86,13 +86,12 @@ here for informational purposes.
<ul>
<li> The service directory created by <a href="s6-instance-maker.html">s6-instance-maker</a>
-has two specific subdirectories in it: <tt>instance</tt> and <tt>instances</tt>. They
-are initially empty, except that the template service directory is stored in
-<tt>instances/.template</tt>. </li>
+has three specific subdirectories in it: <tt>instance</tt> and <tt>instances</tt>, which
+are initially empty, and <tt>template</tt>, storing the template service directory. </li>
<li> When the service is active, there is an <a href="s6-svscan.html">s6-svscan</a>
process running on <tt>instance</tt>. </li>
<li> <a href="s6-instance-create.html">s6-instance-create</a> makes a copy of
-<tt>instances/.template</tt> into <tt>instances/<em>name</em></tt>, and
+<tt>template</tt> into <tt>instances/<em>name</em></tt>, and
<a href="s6-svlink.html">s6-svlink</a>s <tt>instances/<em>name</em></tt> to
<tt>instance</tt>. When it returns, there is an <a href="s6-supervise.html">s6-supervise</a>
process running on <tt>instance/<em>name</em></tt>, and the instance may be up
diff --git a/doc/upgrade.html b/doc/upgrade.html
@@ -18,6 +18,13 @@
<h1> What has changed in s6 </h1>
+<h2> in 2.11.2.1 </h2>
+
+<ul>
+ <li> <a href="//skarnet.org/software/skalibs/">skalibs</a>
+dependency bumped to 2.13.1.0. </li>
+</ul>
+
<h2> in 2.11.2.0 </h2>
<ul>
diff --git a/package/info b/package/info
@@ -1,4 +1,4 @@
package=s6
-version=2.11.2.0
+version=2.11.2.1
category=admin
package_macro_name=S6
diff --git a/src/instance/s6-instance-create.c b/src/instance/s6-instance-create.c
@@ -55,6 +55,21 @@ int main (int argc, char const *const *argv)
namelen = strlen(argv[1]) ;
if (!argv[1][0] || argv[1][0] == '.' || byte_in(argv[1], namelen, " \t\f\r\n", 5) < namelen)
strerr_dief1x(100, "invalid instance name") ;
+
+ {
+ mode_t m = umask(0) ;
+ size_t svlen = strlen(argv[0]) ;
+ char fn[svlen + 11] ;
+ memcpy(fn, argv[0], svlen) ;
+ memcpy(fn + svlen, "/instances", 11) ;
+ if (mkdir(fn, 0755) == -1 && errno != EEXIST)
+ strerr_diefu2sys(111, "mkdir ", fn) ;
+ fn[svlen + 9] = 0 ;
+ if (mkdir(fn, 0755) == -1 && errno != EEXIST)
+ strerr_diefu2sys(111, "mkdir ", fn) ;
+ umask(m) ;
+ }
+
s6_instance_chdirservice(argv[0]) ;
tain_now_set_stopwatch_g() ;
@@ -75,10 +90,10 @@ int main (int argc, char const *const *argv)
else if (errno != ENOENT)
strerr_diefu3sys(111, "stat ", argv[0], sv+2) ;
}
- if (!hiercopy("../instances/.template", sv))
+ if (!hiercopy("../template", sv))
{
cleanup(sv) ;
- strerr_diefu5sys(111, "copy ", argv[0], "/instances/.template to ", argv[0], sv+2) ;
+ strerr_diefu5sys(111, "copy ", argv[0], "/template to ", argv[0], sv+2) ;
}
if (s6_supervise_link_names_g(".", &p, argv + 1, 1, options, &tto) == -1)
{
diff --git a/src/instance/s6-instance-maker.c b/src/instance/s6-instance-maker.c
@@ -62,7 +62,7 @@ static void write_service (char const *dir, char const *template, char const *us
svinfo data = { .user = user, .maxinstances = maxinstances } ;
size_t dirlen = strlen(dir) ;
mode_t m ;
- char fn[dirlen + 21] ;
+ char fn[dirlen + 11] ;
s6_auto_write_service(dir, 3, &write_run, &data, logger) ;
memcpy(fn, dir, dirlen) ;
memcpy(fn + dirlen, "/instance", 10) ;
@@ -71,7 +71,7 @@ static void write_service (char const *dir, char const *template, char const *us
memcpy(fn + dirlen + 9, "s", 2) ;
if (mkdir(fn, 0755) == -1) strerr_diefu2sys(111, "mkdir ", fn) ;
umask(m) ;
- memcpy(fn + dirlen + 10, "/.template", 11) ;
+ memcpy(fn + dirlen, "/template", 10) ;
if (!hiercopy_tmp(template, fn, &sa))
strerr_diefu4sys(111, "copy file hierarchy from ", template, " to ", fn) ;
}
diff --git a/src/libs6/s6_servicedir_file_list.c b/src/libs6/s6_servicedir_file_list.c
@@ -12,8 +12,7 @@ static s6_servicedir_desc const s6_servicedir_file_list_[] =
{ .name = "timeout-finish", .type = S6_FILETYPE_UINT, .options = 0 },
{ .name = "max-death-tally", .type = S6_FILETYPE_UINT, .options = 0 },
{ .name = "down-signal", .type = S6_FILETYPE_NORMAL, .options = 0 },
- { .name = "instance", .type = S6_FILETYPE_DIR, .options = 0 },
- { .name = "instances", .type = S6_FILETYPE_DIR, .options = 0 },
+ { .name = "template", .type = S6_FILETYPE_DIR, .options = 0 },
{ .name = "data", .type = S6_FILETYPE_DIR, .options = 0 },
{ .name = "env", .type = S6_FILETYPE_DIR, .options = 0 },
{ .name = 0, .options = 0 }