[Midnightbsd-cvs] [MidnightBSD/src] 645be0: prowld: implement socket activation (§9)

Lucas Holt noreply at github.com
Sat Apr 18 17:09:20 EDT 2026


  Branch: refs/heads/feature/prowl
  Home:   https://github.com/MidnightBSD/src
  Commit: 645be0f37547a9d684b16a832da8c081ce7d3fdb
      https://github.com/MidnightBSD/src/commit/645be0f37547a9d684b16a832da8c081ce7d3fdb
  Author: Lucas Holt <luke at foolishgames.com>
  Date:   2026-04-18 (Sat, 18 Apr 2026)

  Changed paths:
    M sbin/prowld/Makefile
    M sbin/prowld/dag.c
    M sbin/prowld/job.c
    M sbin/prowld/prowld.c
    M sbin/prowld/prowld.h
    A sbin/prowld/socket_activation.c
    M sbin/prowld/supervisor.c
    M sbin/prowld/unit.c

  Log Message:
  -----------
  prowld: implement socket activation (§9)

Bind and listen on configured sockets at job load time.  On the first
incoming connection the daemon is fork+exec'd with the bound socket fds
passed as fd 3, 4, 5, ... via the LISTEN_FDS / LISTEN_PID /
LISTEN_FDNAMES protocol (systemd-compatible).

- socket_activation.c: new file — socket_bind_one, kqueue add/del,
  socket_bind_all (with rollback), socket_handle_activation,
  socket_rearm, socket_close_all
- supervisor.c: supervisor_socket_activate() fork+execs the daemon;
  child_setup_and_exec() safely dups socket fds to positions 3+ and
  injects LISTEN_* env vars; supervisor_reap() re-arms sockets after
  socket-activated daemon exits
- dag.c: dag_schedule_ready() calls socket_bind_all for socket jobs
  instead of supervisor_start; marks job RUNNING so dependents proceed
- prowld.c: EVFILT_READ dispatch checks bit 0 of udata to distinguish
  socket activation fds (prowl_socket_t*|1) from notify fds (job_t*)
- prowld.h: forward typedefs, prowl_socket_t struct, socket fields in
  job_t, function prototypes
- unit.c: parse sockets block from unit files (AF_UNIX/INET/INET6)
- job.c: initialise socket fd and back-pointer in job_alloc()
- Makefile: add socket_activation.c to SRCS

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