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.
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?
(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.
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.
Created attachment 251022 [details] Update devel/skalibs to 2.14.1.1
Created attachment 251023 [details] Update lang/execline to 2.9.5.1
Created attachment 251024 [details] Update sysutils/s6 to 2.12.0.4
Created attachment 251025 [details] Update sysutils/s6-rc to 0.5.4.2
Created attachment 251026 [details] Bump port revision of sysutils/runwhen to patch in skalibs-2.14 support
This should complete the list of already ported "skaware". These ports are fairly tightly coupled and should be updated together in the ports tree.
Take. Will review this patch set with submitter and then commit.
(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.
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(-)
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(-)
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(-)
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(-)
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(-)
Thank you for your submission.
(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. :)
Thx, but after the initial patch set against runwhen (mostly the introduction of variadic macros in skalibs) the single addition change was trivial.