Repository navigation
Releases
Releases · wushilin/processmaster
v0.6.0
What's Changed
- Use
/run/processmaster.sockas default for socket by @winterheart in #5 - Podman container services, map-form environment by @wushilin in #6
Highlights
- Container services (podman): run an OCI image as a service, with the same cgroup limits, deterministic stop, logging, restart policy and cron as host commands. Images live in processmaster's own store (
pmctl podman …), and unused images are cleaned up automatically. See "Container services (podman)" in the README andexamples/containers/. Requires rootful podman; Docker is not supported. process.environmentaccepts a map (NAME: value); the list form still works.- Auto services: a folder with neither
service.ymlnorrun.shis now skipped instead of getting a generatedrun.shdefault.
Upgrading
- The default control socket is now
/run/processmaster.sock. If you relied on the old default, setunix_socket.pathor pointPMCTL_SOCKat the new path. - As always, deploy
processmasterandpmctlfrom the same build.
Full Changelog: v0.5.1...v0.6.0
v0.5.1
v0.5.0
v0.4.1
v0.4.0
v0.3.1
v0.3.0
Security hardening and supervisor fixes. Some existing configurations stop loading after the upgrade. Read "Before upgrading" first.
Before upgrading
- Auto-service directories must be root-controlled. An auto-service directory owned by (or writable by) the service user is now skipped with an
auto_service_dir_not_root_controlledwarning. Its service stops on the next load. Such a directory can never hold a trusted definition, because the user can rename any root-owned file, even its own log, intoservice.yml. To migrate, move the definition toconfig_directoryand pointprocess.working_directoryat the old directory:Asudo cp dropins/<app>/service.yml conf.d/<app>.yaml && sudo chown root: conf.d/<app>.yaml # then add under process: working_directory: /path/to/dropins/<app>
config_directorydefinition with the same name takes precedence over the skipped directory, with no conflict error. - Definition files must be root-owned and have a single hard link. They may not be writable by others, and may be group-writable only if the group is root.
- Provisioning refuses setuid/setgid modes and paths containing
... max_cpumust be 10m–1024 cores.- Durations are capped at 30 days.
- User flags may only contain
[a-z0-9_.:-]. - Admin actions whose program or script arguments a non-root user could modify are refused at run time. The daemon logs a warning at startup.
command[0]must be absolute and may not beenv. - Web console bcrypt hashes above cost 16 are rejected.
Security
- Root no longer follows symlinks below the root-controlled part of a path when it writes, rotates, prunes or views logs, provisions, reads
@file://values or writes admin-action logs. Root-placed symlinks are resolved one hop at a time, and every directory along the way is trust-checked. - Provisioning works through pinned file descriptors. That covers the recursive chown and setting the capability via
fsetxattr(thesetcapbinary is no longer needed). It refuses hard-linked targets. - Rotated logs are gzipped in-process.
gzip -fused to follow symlinks. - The provisioning marker can no longer hang or exhaust the daemon (FIFO, sparse file).
- Web console:
- bcrypt verification concurrency is capped;
- a source that fails 10 times is locked out, with backoff up to 15 min;
- the dummy hash's cost matches the configured users' cost, so response time no longer reveals which usernames exist;
- anti-framing, nosniff and no-referrer headers are sent;
- HTTPS now shuts down gracefully;
systemctloption injection through unit names is closed.
pmctl/processmasterneutralise terminal escape sequences in service logs and events when printing to a TTY.- The control socket has a 10 s request timeout and a 256-connection cap. Requests that would start processes are refused during shutdown.
- Admin actions run in per-id cgroups, one run per id at a time.
Fixes
- A service that exits immediately after being started (boot, manual start or restart, reload) is now handled by its restart policy (backoff, then FAILED after the tolerance) instead of being marked FAILED on the first attempt.
- A service that exited a few milliseconds after being observed running could be left RUNNING forever with nothing running and no restart: the exit waiter was not attached. Found by the new scenario tests on GitHub's faster runners.
- A manual start of a FAILED service gets a fresh restart budget.
- Stopping during a backoff cancels the pending restart.
updateno longer double-starts a crashing service.- Provisioning is re-applied automatically when a target changes (e.g. a redeployed binary loses
cap_net_bind_service). Old markers trigger one re-run. logs -fno longer stops after 64 MiB.- Out-of-range numbers no longer cause panics or overflows.
- A
cgroup.namewith a leading/works. - The embedded build time/host is no longer frozen at whenever
build.rslast changed.
Build and test
- GitHub Actions workflow: tests, root-only supervisor scenarios, static musl builds for x86_64 and aarch64, and release assets on tags.
tests/supervisor_scenarios.rsruns real daemons against real cgroups: crash loops, daemonizing, SIGTERM-immune, fan-out and more.
v0.2.1
No behavior change to the daemon's supervision logic — this release hardens test
coverage and cross-build tooling on top of v0.2's zombie-reaping fix.
Added
- Six regression tests pin the reaping invariant from every angle: a service that
exits before the daemon finishes disowning it, one that ignores SIGTERM and
needs the cgroup force-kill, a stop_command that times out, a double-forking
(daemonizing) child, a 15-service mixed restart storm, and the constraint that
the reaper must never steal an exit status still owned byChild::wait
(scheduled jobs). 102 tests total, all passing. build_all.sh: cross-builds static musl binaries for both x86_64 and aarch64
viacargo-zigbuildin one shot, with optional dist packaging
(./build_all.sh v0.2.1).
Fixed
start_child_reaper_threadis now idempotent (aOnceguard), so calling it
more than once — as the new tests do — can't spin up duplicate reaper threads.
Assets
processmaster-v0.2.1-x86_64-musl.tar.gz/-aarch64-musl.tar.gz: static,
strippedprocessmaster+pmctlbinaries, no libc dependency.
v0.2
Fixes
- Zombie (
<defunct>) processes under the daemon. Since 09a9b0d the reaper only waits on explicitly registered pids, but every non-scheduled service start path (reload_start,ReloadRestart,ManualStart,ManualRestart,boot_start,failure_auto_restart) dropped itsChildhandle and relied on the cgroup waiter, which never callswaitpid. Each service exit left one zombie for the daemon's lifetime. Service children are now registered with the reaper viadisown_service_child(); scheduled jobs keep their process waiter and exit code. stop_commandhelpers that time out (and are then cgroup-killed) are registered with the reaper instead of leaking.boot_start/failure_auto_restartnow report a real spawn error instead of a misleading "cgroup stayed empty" timeout.spawn_process_waiterregisters the child if the waiter thread cannot be created.
Tests
- New regression test
disowned_service_child_is_reaped_not_left_defunct(101 tests total).
Assets
processmaster-v0.2-x86_64-musl.tar.gz— statically linkedprocessmaster+pmctl(co-built) for x86_64 Linux.
🤖 Generated with Claude Code