alpha
Login
or
Join now
gazagnaire.org
/
ocaml-socket-activation
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Listening sockets inherited from systemd or launchd
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
Pipelines
ocaml-socket-activation
/
test
4 files
at
main
Thomas Gazagnaire
tree: reformat for the upgraded ocamlformat
6w ago
ee76294f
dune
tree: reformat for the upgraded ocamlformat Comment reflow and header reindent produced by the new ocamlformat; no code changes.
1 month ago
test.ml
socket-activation: new package for inherited listening sockets Recover the listening sockets a service manager binds and passes to a daemon already open: systemd sd_listen_fds (LISTEN_PID/LISTEN_FDS/ LISTEN_FDNAMES, descriptors from 3) in pure OCaml on Linux, and launchd launch_activate_socket via a small C stub on macOS, behind one cross-platform interface returning Unix listening sockets. The security model follows sd_listen_fds: descriptors are handed back only when LISTEN_PID equals getpid(), so a fork cannot claim its parent sockets; each fd is set close-on-exec; LISTEN_* is unset after reading so children do not re-inherit. The macOS stub fixes two issues in the ocaml-launchd reference: it frees the array launch_activate_socket allocates, and passes Nothing (not an int sentinel) as the Unix_error argument. No libsystemd dependency; the library depends only on unix + fmt. Eio callers wrap the descriptors with Eio_unix.Net.import_socket_listening. The systemd path is exercised on Linux, the launchd path on macOS.
1 month ago
test_socket_activation.ml
tree: reformat for the upgraded ocamlformat Comment reflow and header reindent produced by the new ocamlformat; no code changes.
1 month ago
test_socket_activation.mli
socket-activation: new package for inherited listening sockets Recover the listening sockets a service manager binds and passes to a daemon already open: systemd sd_listen_fds (LISTEN_PID/LISTEN_FDS/ LISTEN_FDNAMES, descriptors from 3) in pure OCaml on Linux, and launchd launch_activate_socket via a small C stub on macOS, behind one cross-platform interface returning Unix listening sockets. The security model follows sd_listen_fds: descriptors are handed back only when LISTEN_PID equals getpid(), so a fork cannot claim its parent sockets; each fd is set close-on-exec; LISTEN_* is unset after reading so children do not re-inherit. The macOS stub fixes two issues in the ocaml-launchd reference: it frees the array launch_activate_socket allocates, and passes Nothing (not an int sentinel) as the Unix_error argument. No libsystemd dependency; the library depends only on unix + fmt. Eio callers wrap the descriptors with Eio_unix.Net.import_socket_listening. The systemd path is exercised on Linux, the launchd path on macOS.
1 month ago