Bug 279116 - sysutils/s6-rc update to 0.5.4.2
Summary: sysutils/s6-rc update to 0.5.4.2
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Robert Clausecker
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-05-17 22:22 UTC by dewayne
Modified: 2024-06-17 09:22 UTC (History)
2 users (show)

See Also:
crest: maintainer-feedback+


Attachments
Update devel/skalibs to 2.14.1.1 (3.55 KB, patch)
2024-05-27 19:00 UTC, crest
no flags Details | Diff
Update lang/execline to 2.9.5.1 (2.65 KB, patch)
2024-05-27 19:01 UTC, crest
no flags Details | Diff
Update sysutils/s6 to 2.12.0.4 (3.44 KB, patch)
2024-05-27 19:02 UTC, crest
no flags Details | Diff
Update sysutils/s6-rc to 0.5.4.2 (2.89 KB, patch)
2024-05-27 19:04 UTC, crest
no flags Details | Diff
Bump port revision of sysutils/runwhen to patch in skalibs-2.14 support (2.14 KB, patch)
2024-05-27 19:06 UTC, crest
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description dewayne 2024-05-17 22:22:05 UTC
There has been a lot of changes to the skanet suite available via FreeBSD ports system.

Origin		Port entry	Update Available/Detail
sysutils/s6	2.11.3.2	2.12.0.4  New options for s6-svc, s6-log. svscan new options -C -L
sysutils/s6-rc	0.5.4.1		0.5.4.2
lang/execline	2.9.3.0		2.9.5.1   New env variable for backtick
develskalibs	2.13.1.1	2.14.1.1  Quite a few code changes to 2.14.0.0

Occassionally I read through the changes and they're often substantial, without being a functional change.  I'm requesting an upgrade so the code differences that may cause a problem on a FreeBSD upgrade are tractable.
Comment 1 crest 2024-05-23 16:43:51 UTC
Yes the skaware ports have to be kept in sync or they break... I have to check what happened to my release notification mails. Do you want to write up the patches or should I do it?
Comment 2 dewayne 2024-05-27 06:02:22 UTC
(In reply to crest from comment #1)
Unfortunately I don't have any cycles.  However if interested I can forward one of the two changes that I've made to s6.  I changed s6-envuidgid to use login class resources which is FreeBSD specific and unlikely to change per 
+        if (setusercontext(NULL, pw, uid, LOGIN_SETALL) != 0)  /* FreeBSD LOGIN_SETALL=0x07ff enable all capabilities */

Because I do a lot of auditing and have 21 different time formats (who knew) in log files, I've modied s6-log.c to use g or G to use seconds or seconds+microseconds. Though during a breakin or RCA ms is sufficient. 

+    if (gflags & 8)        /* g secs since 1970 */
+      hlen = snprintf(&hstamp[0], 32, "%lu ", tv.tv_sec);
+    if (gflags & 0x10)     /* G sec.microsec since 1970 */
+      hlen = snprintf(&hstamp[0], 32, "%lu.%0.4lu ", tv.tv_sec, tv.tv_usec/100);

I considered sending to Laurent but he's pretty attached to tai64 and seems to want to avoid OS specifics.
Comment 3 crest 2024-05-27 10:02:17 UTC
Afaik only FreeBSD tracks the login class in the kernel via setloginclass(2). Sadly the FreeBSD base system lacks a chain-loadable command that just calls setloginclass(2) and execs into its remaining arguments.

Every command that's available to shell (or execline) scripts (e.g. su) doesn't exec(), but fork()+exec() which is a problem for reliable process supervision without using operating system specific APIs (e.g. sub-reapers).

Do you want to have the inner nodes of the supervision tree (s6-svscan, s6-supervise) modify their login class or only the run/finish/check/up/down scripts? In the latter case adding the "missing chain-loader" as its own tiny should solve the problem and avoid the hassle of maintaining a FreeBSD specific feature patch even if it's small.
Comment 4 crest 2024-05-27 19:00:26 UTC
Created attachment 251022 [details]
Update devel/skalibs to 2.14.1.1
Comment 5 crest 2024-05-27 19:01:09 UTC
Created attachment 251023 [details]
Update lang/execline to 2.9.5.1
Comment 6 crest 2024-05-27 19:02:36 UTC
Created attachment 251024 [details]
Update sysutils/s6 to 2.12.0.4
Comment 7 crest 2024-05-27 19:04:31 UTC
Created attachment 251025 [details]
Update sysutils/s6-rc to 0.5.4.2
Comment 8 crest 2024-05-27 19:06:45 UTC
Created attachment 251026 [details]
Bump port revision of sysutils/runwhen to patch in skalibs-2.14 support
Comment 9 crest 2024-05-27 22:08:58 UTC
This should complete the list of already ported "skaware". These ports are fairly tightly coupled and should be updated together in the ports tree.
Comment 10 Robert Clausecker freebsd_committer freebsd_triage 2024-05-27 22:23:09 UTC
Take.  Will review this patch set with submitter and then commit.
Comment 11 dewayne 2024-05-28 07:23:58 UTC
(In reply to crest from comment #3)
Thanks for the prompt updates.

Yes, I only require use of login class during run/finish/check/up/down scripts.  I hadn't considered modified s6-supervise.  As I use run processes within jailed environments and use other goodies like (MAC) partition labelling, I think the right place is in run/...  Unless there's a better way? :)

Aside: Yes I had modifed the FreeBSD base to properly allow s6 to manage all options available via login.conf.  Central management is preferred.

After a year or two of running s6-svscan as PID 1, I'm very happy with s6-rc. Thank-you for supporting the suite on FreeBSD.
Comment 12 commit-hook freebsd_committer freebsd_triage 2024-06-16 12:57:28 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=77fa197321f0768a7758b78377c6e1ba47a7a8c8

commit 77fa197321f0768a7758b78377c6e1ba47a7a8c8
Author:     Jan Bramkamp <crest@rlwinm.de>
AuthorDate: 2024-05-27 13:20:47 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2024-06-16 11:54:29 +0000

    sysutils/s6: Update to version 2.12.0.4

    List of changes between 2.11.3.2 and 2.12.0.4 mentioned in the ./NEWS file:

    In 2.21.0.1 - 2.12.0.4
    ----------------------
     - Bugfixes.

    In 2.12.0.0
    -----------
     - New option to s6-svc: -s, to specify a signal by name (or number).
     - New option to s6-log: -t, to specify a timeout for partial last lines.
     - s6-svscan rewrite: no more quadratic reaps, no more forced 1s wait on shutdown
     - Eliminated fork() wherever possible on systems supporting posix_spawn()
     - Obsolete s6lockd subsystem removed.

    PR:             279116

 sysutils/s6/Makefile  |  6 +++---
 sysutils/s6/distinfo  |  6 +++---
 sysutils/s6/pkg-plist | 11 +++++------
 3 files changed, 11 insertions(+), 12 deletions(-)
Comment 13 commit-hook freebsd_committer freebsd_triage 2024-06-16 12:57:30 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=f1af459530488e1b5024d92108f68b32f5de37c9

commit f1af459530488e1b5024d92108f68b32f5de37c9
Author:     Jan Bramkamp <crest@rlwinm.de>
AuthorDate: 2024-05-27 12:45:14 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2024-06-16 11:54:28 +0000

    lang/execline: Update to version 2.9.5.1

    Give read+execute permissions to everyone on symlinks:
     - bin/cd    -> execline-cd
     - bin/umask -> execline-umask

    List of changes between 2.9.3.0 and 2.9.5.1 mentioned in the ./NEWS file:

    In 2.9.5.1
    ----------
     - Bugfixes.

    In 2.9.5.0
    ----------
     - Bugfixes.
     - backtick now sets ? when it can be nonzero.

    In 2.9.4.0
    ----------
     - Adaptation to skalibs-2.14.0.0.
     - New dummy -e option in execlineb.
     - Slightly better error reporting in execlineb.

    PR:             279116

 lang/execline/Makefile  | 4 ++--
 lang/execline/distinfo  | 6 +++---
 lang/execline/pkg-plist | 6 +++++-
 3 files changed, 10 insertions(+), 6 deletions(-)
Comment 14 commit-hook freebsd_committer freebsd_triage 2024-06-16 12:57:31 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=08c29b75528b4925e062fff9eee44c3986dcd595

commit 08c29b75528b4925e062fff9eee44c3986dcd595
Author:     Jan Bramkamp <crest@rlwinm.de>
AuthorDate: 2024-05-27 12:05:26 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2024-06-16 11:54:28 +0000

    devel/skalibs: Update to version 2.14.1.1

    List of changes between 2.13.1.1 and 2.14.1.1 mentioned in the ./NEWS file:

    In 2.14.1.1
    -----------
     - Bugfixes.

    In 2.14.1.0
    -----------
     - Bugfixes.
     - Portability improvements.
     - New socket_sendnb46_g() and socket_recvnb46_g() macros.

    In 2.14.0.1
    -----------
     - Bugfixes.

    In 2.14.0.0
    -----------
     - Bugfixes.
     - New accessor function: selfpipe_fd().
     - New functions: slurpn(), openslurpnclose().
     - slurp() and openslurpclose() are now macros.
     - New strerr macros to warn with a "fatal" message.
     - New cdb functions: cdb_hashv(), cdbmake_addv().
     - child_spawn() revamp. Prototype change (last arg is a size_t).
     - case_lowerb() and friends now use ctype.h functions.
     - case_str() removed, strcasestr() fallback implementation added.
     - cspawn(): finally unifying fork() and posix_spawn().
     - Better support for nonstandard posix_spawn subfunctions.
     - Lots of new sysdeps.

    PR:             279116

 devel/skalibs/Makefile  | 2 +-
 devel/skalibs/distinfo  | 6 +++---
 devel/skalibs/pkg-plist | 9 +++++++--
 3 files changed, 11 insertions(+), 6 deletions(-)
Comment 15 commit-hook freebsd_committer freebsd_triage 2024-06-16 12:57:33 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=466b18e8dd474038da7a629574a69d7bd3f3214a

commit 466b18e8dd474038da7a629574a69d7bd3f3214a
Author:     Jan Bramkamp <crest@rlwinm.de>
AuthorDate: 2024-05-27 18:50:02 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2024-06-16 11:54:29 +0000

    sysutils/runwhen: Add skalibs-2.14 support

    Patch skalibs-2.14 support into runwhen-2021.04.30:
      - Skalibs no longer pollutes the namespace with uint64 (without _t).
      - Patch runwhen to use uint64_t instead of uint64.
      - Update dependency to devel/skalibs>=2.14.1.1
      - Bump port revision.

    No functional change intended.

    PR:             279116

 sysutils/runwhen/Makefile                   | 4 ++--
 sysutils/runwhen/files/patch-src_rw__scan.c | 9 ++++++---
 2 files changed, 8 insertions(+), 5 deletions(-)
Comment 16 commit-hook freebsd_committer freebsd_triage 2024-06-16 12:57:35 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=6e5298df63d54cdac96dc1137cec31698cdd37c7

commit 6e5298df63d54cdac96dc1137cec31698cdd37c7
Author:     Jan Bramkamp <crest@rlwinm.de>
AuthorDate: 2024-05-27 14:09:01 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2024-06-16 11:54:29 +0000

    sysutils/s6-rc: Update to 0.5.4.2

    Also move USES below FLAVORS and FLAVOR in port Makefile as recommended by portlint.

    List of changes between 0.5.4.1 and 0.5.4.2 mentioned in the ./NEWS file:

    In 0.5.4.2
    ----------
     - Adaptation to skalibs-2.14.0.0.
     - Bugfixes.

    PR:             279116

 sysutils/s6-rc/Makefile  | 22 +++++++++++-----------
 sysutils/s6-rc/distinfo  |  6 +++---
 sysutils/s6-rc/pkg-plist |  2 +-
 3 files changed, 15 insertions(+), 15 deletions(-)
Comment 17 Robert Clausecker freebsd_committer freebsd_triage 2024-06-16 13:15:26 UTC
Thank you for your submission.
Comment 18 dewayne 2024-06-16 23:57:36 UTC
(In reply to Robert Clausecker from comment #17)
Thank-you Jan, that's a lot of work. I would've been stumped with the rw_scan.c change, I'm glad you had eyes on it. :)
Comment 19 crest 2024-06-17 09:22:38 UTC
Thx, but after the initial patch set against runwhen (mostly the introduction of variadic macros in skalibs) the single addition change was trivial.