From 80d231165357cf0d57b23dfe3b0aa16c7cb79545 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Tue, 31 Jan 2023 12:06:01 +0000 Subject: Prepare for 2.11.2.1, move template location, change file list Signed-off-by: Laurent Bercot --- INSTALL | 2 +- NEWS | 7 +++++++ doc/index.html | 4 ++-- doc/instances.html | 7 +++---- doc/upgrade.html | 7 +++++++ package/info | 2 +- src/instance/s6-instance-create.c | 19 +++++++++++++++++-- src/instance/s6-instance-maker.c | 4 ++-- src/libs6/s6_servicedir_file_list.c | 3 +-- 9 files changed, 41 insertions(+), 14 deletions(-) diff --git a/INSTALL b/INSTALL index c535c20..a840c43 100644 --- 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 index 3f8727c..a51e51d 100644 --- 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 index e41fa67..b1a8c69 100644 --- a/doc/index.html +++ b/doc/index.html @@ -83,7 +83,7 @@ with s6
  • A POSIX-compliant system with a standard C development environment
  • GNU make, version 3.81 or later
  • skalibs 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.
  • (Optional, but really recommended for full functionality): @@ -115,7 +115,7 @@ want nsswitch-like functionality:

    Download

      -
    • The current released version of s6 is 2.11.2.0.
    • +
    • The current released version of s6 is 2.11.2.1.
    • Alternatively, you can checkout a copy of the s6 git repository: diff --git a/doc/instances.html b/doc/instances.html index de0d0d4..41c5722 100644 --- a/doc/instances.html +++ b/doc/instances.html @@ -86,13 +86,12 @@ here for informational purposes.
      • The service directory created by s6-instance-maker -has two specific subdirectories in it: instance and instances. They -are initially empty, except that the template service directory is stored in -instances/.template.
      • +has three specific subdirectories in it: instance and instances, which +are initially empty, and template, storing the template service directory.
      • When the service is active, there is an s6-svscan process running on instance.
      • s6-instance-create makes a copy of -instances/.template into instances/name, and +template into instances/name, and s6-svlinks instances/name to instance. When it returns, there is an s6-supervise process running on instance/name, and the instance may be up diff --git a/doc/upgrade.html b/doc/upgrade.html index 7afba07..e310554 100644 --- a/doc/upgrade.html +++ b/doc/upgrade.html @@ -18,6 +18,13 @@

        What has changed in s6

        +

        in 2.11.2.1

        + +
          +
        • skalibs +dependency bumped to 2.13.1.0.
        • +
        +

        in 2.11.2.0

          diff --git a/package/info b/package/info index c1226a9..906d248 100644 --- 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 index 5c25433..b1d2c65 100644 --- 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 index 8a82157..fcb67ac 100644 --- 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 index b01a59f..6460426 100644 --- 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 } -- cgit v1.2.3