Repository navigation
Releases
Releases · rglonek/docker-systemd
v1.0.0 - 1a67de1
Clean-room reimplementation against the design in designs/docs/next/. The
whole LD_PRELOAD subsystem, the four committed .so blobs and the old
systemd/, procwait/, journalctl/, systemctl/ and common/ packages are
deleted.
Process tracking
- Replace
LD_PRELOADfork interposition with per-unit subreaper
supervisors. Each unit runs under a dedicated process that sets
PR_SET_CHILD_SUBREAPER=1, so orphaned descendants reparent to it rather
than to PID 1 and unit membership becomes exact. Measured, the old shim saw
2 of 6 child-creation paths and misseddaemon(3)— the case it existed to
solve — entirely. systemctl stopcan now stop aType=forkingservice. The termination
ladder signals every member of the unit's live tree individually,
re-enumerating each round, so it converges even against a process that forks
on every signal. Process-group kills are used only as a cheap supplement:
measured,kill(-pgid)does not stop a daemonised service.pidfd_open/pidfd_send_signalare used where available, eliminating
PID-reuse mis-targeting.- cgroup v2 is auto-detected and used as an accelerator when a writable
hierarchy is available; it is never required. - Orphan recovery: if a supervisor dies, its processes are found again by an
invocation-id environment marker and handed to a replacement. --no-pidtrackis accepted and ignored with a deprecation warning.
Correctness
- Unit commands no longer run through
/bin/bash -c. systemd's own command
lexer is implemented: prefixes-,@,:,+,!,!!; quoting;
C-style escapes;$VAR/${VAR}expansion with systemd's word-splitting
rule; no globs, pipes, redirection or command substitution. - Full boolean grammar:
RemainAfterExit=yesnow parses as true. Type=notifyis implemented with a real$NOTIFY_SOCKETand
SCM_CREDENTIALS, rather than being silently treated asforking.Before=/After=are honoured: transactions are topologically ordered,
units in a stratum start in parallel, and an ordering cycle is broken with a
warning rather than hanging the boot.Requisite=no longer starts its dependency;OnFailure=/OnSuccess=no
longer create a bogus inverse edge;StopWhenUnneeded=works.Type=oneshotruns itsExecStart=lines sequentially and no longer forces
RemainAfterExit. MultipleExecStart=lines for other types are a parse
error rather than being started in parallel.PIDFile=is parsed strictly and the pid is validated as a member of the
unit's tree; a stale or hostile pid file fails the unit instead of making
init adopt — and later kill — an unrelated process.TimeoutStartSec=is implemented andTimeoutStopSec=defaults to 90 s;
a hangingExecStartPre=fails its own unit instead of the whole boot.StartLimitIntervalSec=/StartLimitBurst=stop a crash-looping unit from
restarting for ever;RestartSec=honours values below one second.EnvironmentFile=is parsed properly (comments, blanks,export, quotes,
continuations, optional-prefix);Environment=accepts several
space-separated assignments per line.- Full specifier table (
%n %N %p %P %i %I %f %j %t %S %C %L %E %h %u %U %g %G %H %m %b %v %a %%), expanded in every directive systemd expands them in. User=/Group=are applied whenever either is set, supplementary groups are
set, and$HOME/$USER/$LOGNAME/$SHELLare exported. An unresolvable
User=fails the unit with217/USERrather than falling back to root.Limit*=directives now work, clamped to the container's inherited hard
limits with a diagnostic naming thedocker run --ulimitthat would fix it.- New:
UMask=,Nice=,OOMScoreAdjust=,NoNewPrivileges=,
WorkingDirectory=,RuntimeDirectory=and itsState/Cache/Logs/
Configurationsiblings,StandardInput=/StandardOutput=/
StandardError=,SyslogIdentifier=, theCondition*=/Assert*=families,
KillMode=/KillSignal=/FinalKillSignal=/SendSIGHUP=/SendSIGKILL=. .targetunits are first-class, with well-known targets synthesised on
demand soAfter=network.targetresolves.- Templates are resolved from their template file, never materialised;
delete-instanceremoves only the enable symlink. set-environmentandunset-environmentare no longer swapped.maskcreates the right symlink instead of a file calledtargetin init's
working directory; mask state is derived from the filesystem on every load.enablewrites real symlinks into the[Install]-named target's.wants
or.requiresdirectory, honouringAlias=andAlso=.- Unit discovery de-duplicates directories by
realpath, scans
/run/systemd/system, and applies drop-ins from all four search-path
directories plus the type-wide and template directories.
Reliability
- PID 1 is a thin dispatcher: it never execs a unit command and never blocks on
one. Per-unit state is owned by one supervisor, dependency edges are stored
as names and resolved at use time, and every unit actor has a top-level
recover — the nine container-fatal crash and hang defects are removed by
construction. - Shutdown is reverse-topological and parallel within a stratum, under a global
budget, with a three-signal operator escape hatch and a final sweep and reap. daemon-reloadno longer rebuilds the definitions of running units: a
running job keeps the configuration it was started with.
Protocol, CLI and logging
- New length-prefixed, versioned, typed control protocol: no single-
read()
assumption, no0x00sentinel, no 64 KiB cap, and aHELLOhandshake that
diagnoses a stale client instead of misparsing. systemctlgainstry-restart,reload-or-restart,is-failed,
is-enabled,list-unit-files,list-dependencies,cat,preset,
preset-all,link,revert,add-wants,add-requires,kill,
isolate,reset-failed,daemon-reexec,show -p X --value, and the
systemd exit-code table. An unknown verb exits 2 rather than 0.journalctlis native:-uis optional,-ntails the file (it used to
tail init's stdin),-fuses inotify,-S/-U/-bwork independently of
each other, plus-p,-o,-g,-r,--disk-usageand--vacuum-*.- Log records carry an RFC3339-microsecond UTC timestamp, a syslog priority and
the unit and pid, so time filters work at all; legacy un-timestamped lines
are still readable. Logs rotate by size with a total cap. - New
systemd-notifyandsystemd-detect-virthelpers, and
/run/systemd/systemis created so distro maintainer scripts stop skipping
unit registration.
Security
- Runtime state moved to
/run/docker-systemd/(0700 root:root) with the
control socket at0600andSO_PEERCREDauthentication: only uid 0 may
control the manager. The old/tmpsocket let any uid in the container start
a root unit or power the container off. - The world-writable pidtrack socket,
/var/log/pidtrack.logand
/etc/ld.so.preloadmanipulation are gone with the shim. - Unit log files are
0640 root:adm.
Build and test
- First automated tests: unit tests with the race detector, four fuzz targets,
a process-level suite that runs real daemonising services, and a conformance
matrix across ten base images includingalpine:3. - The toolchain is pinned in
go.mod; no UPX; no committed binary artefacts;
every release artefact is reproducible from a clean checkout by CI.
v0.5.0 - 550d55b
CHANGELOG
v0.5.0
- add timeout handling and
wpid==0handling toprocwaitinFinalReap - add
isShuttingDownmethod todaemonto check if the system is shutting down to prevent starting new services during shutdown
v0.4.5
- add
dockerbuild.shscript to buildLD_PRELOADlibraries for different architectures - build against older supported versions of
glibc
v0.4.2
- add error handling to
LD_PRELOADlibraries - fix
arm64versions ofLD_PRELOADlibraries
v0.4.1
- daemons should also inherit
os.Environ()of systemd process - support
set-environmentandunset-environmentfeatures of systemd/systemctl - disable journalctl pager; feature will be ignored; to page, simply pipe to
moreorless
v0.4.0
- redo the
systemddaemon handler, using signals and states instead of long-lasting mutex locks to allow for better state flow and querying capability - add
versionsystemctl command to print version
v0.3.3
- bump dependencies
- automated docker build system
v0.3.2
- improve
syscall.Wait4call error handling inprocwait - improve communication protocol between
systemd.commandandsystemctlso that multiple messages can be sent and printed to user during the command execution process
v0.3.1
- add
--nowoption tosystemctl enable
v0.3.0
- big change - not using double-process-init method for controlling and reaping processes; instead using a single init with a single dispatching
syscall.Wait4(-1,...)- this allows for a more streamlined approach, single-pid init process, as well as improved tracking of other PIDs
- more importantly, the forking-process wait system now can pause and wait on a mutex instead of timed polling, making this much more efficient
v0.2.1
- support tracking processes that fork-detach themselves late (corner-case)
- running enable/start on a multi-instance will create that instance automatically
v0.2.0
- first runnable release which properly tracks pids and reaps zombie processes
- added
ld_preloadfeature for fork process tracking and multiple bugfixes
v0.4.5 - 70bf517
CHANGELOG
v0.4.5
- add
dockerbuild.shscript to buildLD_PRELOADlibraries for different architectures - build against older supported versions of
glibc
v0.4.2
- add error handling to
LD_PRELOADlibraries - fix
arm64versions ofLD_PRELOADlibraries
v0.4.1
- daemons should also inherit
os.Environ()of systemd process - support
set-environmentandunset-environmentfeatures of systemd/systemctl - disable journalctl pager; feature will be ignored; to page, simply pipe to
moreorless
v0.4.0
- redo the
systemddaemon handler, using signals and states instead of long-lasting mutex locks to allow for better state flow and querying capability - add
versionsystemctl command to print version
v0.3.3
- bump dependencies
- automated docker build system
v0.3.2
- improve
syscall.Wait4call error handling inprocwait - improve communication protocol between
systemd.commandandsystemctlso that multiple messages can be sent and printed to user during the command execution process
v0.3.1
- add
--nowoption tosystemctl enable
v0.3.0
- big change - not using double-process-init method for controlling and reaping processes; instead using a single init with a single dispatching
syscall.Wait4(-1,...)- this allows for a more streamlined approach, single-pid init process, as well as improved tracking of other PIDs
- more importantly, the forking-process wait system now can pause and wait on a mutex instead of timed polling, making this much more efficient
v0.2.1
- support tracking processes that fork-detach themselves late (corner-case)
- running enable/start on a multi-instance will create that instance automatically
v0.2.0
- first runnable release which properly tracks pids and reaps zombie processes
- added
ld_preloadfeature for fork process tracking and multiple bugfixes
v0.4.4 - b472df8
CHANGELOG
v0.4.2
- add error handling to
LD_PRELOADlibraries - fix
arm64versions ofLD_PRELOADlibraries
v0.4.1
- daemons should also inherit
os.Environ()of systemd process - support
set-environmentandunset-environmentfeatures of systemd/systemctl - disable journalctl pager; feature will be ignored; to page, simply pipe to
moreorless
v0.4.0
- redo the
systemddaemon handler, using signals and states instead of long-lasting mutex locks to allow for better state flow and querying capability - add
versionsystemctl command to print version
v0.3.3
- bump dependencies
- automated docker build system
v0.3.2
- improve
syscall.Wait4call error handling inprocwait - improve communication protocol between
systemd.commandandsystemctlso that multiple messages can be sent and printed to user during the command execution process
v0.3.1
- add
--nowoption tosystemctl enable
v0.3.0
- big change - not using double-process-init method for controlling and reaping processes; instead using a single init with a single dispatching
syscall.Wait4(-1,...)- this allows for a more streamlined approach, single-pid init process, as well as improved tracking of other PIDs
- more importantly, the forking-process wait system now can pause and wait on a mutex instead of timed polling, making this much more efficient
v0.2.1
- support tracking processes that fork-detach themselves late (corner-case)
- running enable/start on a multi-instance will create that instance automatically
v0.2.0
- first runnable release which properly tracks pids and reaps zombie processes
- added
ld_preloadfeature for fork process tracking and multiple bugfixes
v0.4.3 - b52d8bf
CHANGELOG
v0.4.2
- add error handling to
LD_PRELOADlibraries - fix
arm64versions ofLD_PRELOADlibraries
v0.4.1
- daemons should also inherit
os.Environ()of systemd process - support
set-environmentandunset-environmentfeatures of systemd/systemctl - disable journalctl pager; feature will be ignored; to page, simply pipe to
moreorless
v0.4.0
- redo the
systemddaemon handler, using signals and states instead of long-lasting mutex locks to allow for better state flow and querying capability - add
versionsystemctl command to print version
v0.3.3
- bump dependencies
- automated docker build system
v0.3.2
- improve
syscall.Wait4call error handling inprocwait - improve communication protocol between
systemd.commandandsystemctlso that multiple messages can be sent and printed to user during the command execution process
v0.3.1
- add
--nowoption tosystemctl enable
v0.3.0
- big change - not using double-process-init method for controlling and reaping processes; instead using a single init with a single dispatching
syscall.Wait4(-1,...)- this allows for a more streamlined approach, single-pid init process, as well as improved tracking of other PIDs
- more importantly, the forking-process wait system now can pause and wait on a mutex instead of timed polling, making this much more efficient
v0.2.1
- support tracking processes that fork-detach themselves late (corner-case)
- running enable/start on a multi-instance will create that instance automatically
v0.2.0
- first runnable release which properly tracks pids and reaps zombie processes
- added
ld_preloadfeature for fork process tracking and multiple bugfixes
v0.4.2 - 204e16e
CHANGELOG
v0.4.2
- add error handling to
LD_PRELOADlibraries - fix
arm64versions ofLD_PRELOADlibraries
v0.4.1
- daemons should also inherit
os.Environ()of systemd process - support
set-environmentandunset-environmentfeatures of systemd/systemctl - disable journalctl pager; feature will be ignored; to page, simply pipe to
moreorless
v0.4.0
- redo the
systemddaemon handler, using signals and states instead of long-lasting mutex locks to allow for better state flow and querying capability - add
versionsystemctl command to print version
v0.3.3
- bump dependencies
- automated docker build system
v0.3.2
- improve
syscall.Wait4call error handling inprocwait - improve communication protocol between
systemd.commandandsystemctlso that multiple messages can be sent and printed to user during the command execution process
v0.3.1
- add
--nowoption tosystemctl enable
v0.3.0
- big change - not using double-process-init method for controlling and reaping processes; instead using a single init with a single dispatching
syscall.Wait4(-1,...)- this allows for a more streamlined approach, single-pid init process, as well as improved tracking of other PIDs
- more importantly, the forking-process wait system now can pause and wait on a mutex instead of timed polling, making this much more efficient
v0.2.1
- support tracking processes that fork-detach themselves late (corner-case)
- running enable/start on a multi-instance will create that instance automatically
v0.2.0
- first runnable release which properly tracks pids and reaps zombie processes
- added
ld_preloadfeature for fork process tracking and multiple bugfixes
v0.4.1 - 71d0581
CHANGELOG
v0.4.1
- daemons should also inherit
os.Environ()of systemd process - support
set-environmentandunset-environmentfeatures of systemd/systemctl - disable journalctl pager; feature will be ignored; to page, simply pipe to
moreorless
v0.4.0
- redo the
systemddaemon handler, using signals and states instead of long-lasting mutex locks to allow for better state flow and querying capability - add
versionsystemctl command to print version
v0.3.3
- bump dependencies
- automated docker build system
v0.3.2
- improve
syscall.Wait4call error handling inprocwait - improve communication protocol between
systemd.commandandsystemctlso that multiple messages can be sent and printed to user during the command execution process
v0.3.1
- add
--nowoption tosystemctl enable
v0.3.0
- big change - not using double-process-init method for controlling and reaping processes; instead using a single init with a single dispatching
syscall.Wait4(-1,...)- this allows for a more streamlined approach, single-pid init process, as well as improved tracking of other PIDs
- more importantly, the forking-process wait system now can pause and wait on a mutex instead of timed polling, making this much more efficient
v0.2.1
- support tracking processes that fork-detach themselves late (corner-case)
- running enable/start on a multi-instance will create that instance automatically
v0.2.0
- first runnable release which properly tracks pids and reaps zombie processes
- added
ld_preloadfeature for fork process tracking and multiple bugfixes
v0.4.0 - 6c09dbe
CHANGELOG
v0.4.0
- redo the
systemddaemon handler, using signals and states instead of long-lasting mutex locks to allow for better state flow and querying capability - add
versionsystemctl command to print version
v0.3.3
- bump dependencies
- automated docker build system
v0.3.2
- improve
syscall.Wait4call error handling inprocwait - improve communication protocol between
systemd.commandandsystemctlso that multiple messages can be sent and printed to user during the command execution process
v0.3.1
- add
--nowoption tosystemctl enable
v0.3.0
- big change - not using double-process-init method for controlling and reaping processes; instead using a single init with a single dispatching
syscall.Wait4(-1,...)- this allows for a more streamlined approach, single-pid init process, as well as improved tracking of other PIDs
- more importantly, the forking-process wait system now can pause and wait on a mutex instead of timed polling, making this much more efficient
v0.2.1
- support tracking processes that fork-detach themselves late (corner-case)
- running enable/start on a multi-instance will create that instance automatically
v0.2.0
- first runnable release which properly tracks pids and reaps zombie processes
- added
ld_preloadfeature for fork process tracking and multiple bugfixes
v0.3.3 - 614cea5
CHANGELOG
v0.3.3
- bump dependencies
- automated docker build system
v0.3.2
- improve
syscall.Wait4call error handling inprocwait - improve communication protocol between
systemd.commandandsystemctlso that multiple messages can be sent and printed to user during the command execution process
v0.3.1
- add
--nowoption tosystemctl enable
v0.3.0
- big change - not using double-process-init method for controlling and reaping processes; instead using a single init with a single dispatching
syscall.Wait4(-1,...)- this allows for a more streamlined approach, single-pid init process, as well as improved tracking of other PIDs
- more importantly, the forking-process wait system now can pause and wait on a mutex instead of timed polling, making this much more efficient
v0.2.1
- support tracking processes that fork-detach themselves late (corner-case)
- running enable/start on a multi-instance will create that instance automatically
v0.2.0
- first runnable release which properly tracks pids and reaps zombie processes
- added
ld_preloadfeature for fork process tracking and multiple bugfixes
v0.3.2 - 33b1a64
CHANGELOG
v0.3.2
- improve
syscall.Wait4call error handling inprocwait - improve communication protocol between
systemd.commandandsystemctlso that multiple messages can be sent and printed to user during the command execution process
v0.3.1
- add
--nowoption tosystemctl enable
v0.3.0
- big change - not using double-process-init method for controlling and reaping processes; instead using a single init with a single dispatching
syscall.Wait4(-1,...)- this allows for a more streamlined approach, single-pid init process, as well as improved tracking of other PIDs
- more importantly, the forking-process wait system now can pause and wait on a mutex instead of timed polling, making this much more efficient
v0.2.1
- support tracking processes that fork-detach themselves late (corner-case)
- running enable/start on a multi-instance will create that instance automatically
v0.2.0
- first runnable release which properly tracks pids and reaps zombie processes
- added
ld_preloadfeature for fork process tracking and multiple bugfixes