[Midnightbsd-cvs] [MidnightBSD/src] ac7629: prowld: support read-only media and early/PID-1 op...
Lucas Holt
noreply at github.com
Sat Apr 18 17:24:23 EDT 2026
Branch: refs/heads/feature/prowl
Home: https://github.com/MidnightBSD/src
Commit: ac7629f360ffa148bdbd7d3ae48d3070c95a783f
https://github.com/MidnightBSD/src/commit/ac7629f360ffa148bdbd7d3ae48d3070c95a783f
Author: Lucas Holt <luke at foolishgames.com>
Date: 2026-04-18 (Sat, 18 Apr 2026)
Changed paths:
M sbin/prowld/ipc.c
M sbin/prowld/job.c
M sbin/prowld/prowld.c
M sbin/prowld/prowld.h
M sbin/prowld/supervisor.c
Log Message:
-----------
prowld: support read-only media and early/PID-1 operation
Three practical fixes for operation on CD-ROM, read-only USB, or any
environment where /var is not yet writable at startup:
1. Runtime path globals (g_run_dir, g_notify_dir, g_sock_path, …)
Replace all compile-time PROWLD_* macro references in prowld.c,
ipc.c, supervisor.c and job.c with mutable globals defaulting to
the same paths. setup_runtime_paths(base) rebuilds all nine paths
from a single base directory.
2. Read-only fallback in ensure_dirs()
If the primary run directory (/var/run/prowld) cannot be created
(EROFS, EACCES, missing parent), prowld automatically falls back to
/tmp/prowld and rebuilds all runtime paths under that tmpfs tree.
The -s <dir> flag allows an explicit override at startup.
Non-critical directory failures (db, log) are logged as warnings
rather than aborting.
3. PID 1 / init support
If getpid() == 1 (kernel exec'd prowld as init), daemon() is skipped
to avoid orphaning the child and panicking the kernel. Debug/console
output is forced on. After orderly shutdown, reboot(RB_HALT) is
called instead of exit(0) since PID 1 must never return.
4. IPC non-fatal
ipc_init() failure is downgraded from fatal to a warning. prowld
continues managing services; prowlctl commands are unavailable until
the socket directory becomes writable (e.g. after varmfs mounts).
5. Generated unit dir
startup_load() and reload_config() now also scan g_generated_dir so
dynamically generated units are loaded regardless of where the
runtime tree lives.
AI-Assisted-by: Claude Sonnet 4.6
Signed-off-by: Lucas Holt <luke at foolishgames.com>
To unsubscribe from these emails, change your notification settings at https://github.com/MidnightBSD/src/settings/notifications
More information about the Midnightbsd-cvs
mailing list