Radish alpha
h
rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5
Radicle Heartwood Protocol & Stack
Radicle
Git
node: Socket Activation with systemd using `libsystemd`
Archived lorenz opened 1 year ago

This implements socket activation for radicle-node by cooperating with systemd. Patch 648d8d0 is an alternative implementation without using libsystemd.

For convenience, the libsystemd crate, which implements utilities (without linking any C code) is used. It boils down to reading a few environment variables and converting them into raw file descriptors in a light wrapper.

A recording of socket activation in action, where execution of rad node status automatically starts the node: https://asciinema.org/a/R7N2N9JPvU8MMQh4LRD2FJQzW.

Note that socket activation is nothing specific to systemd. On OS X, launchd supports the same mechanism with a similar API. The JavaScript library node-socket-activation implements socket activation for both systemd and launchd.

See also:

lorenz opened with revision b25bed25 on base a4e10f03 +130 -13 1 year ago

This implements socket activation for radicle-node by cooperating with systemd. Patch 648d8d0 is an alternative implementation without using libsystemd.

For convenience, the libsystemd crate, which implements utilities (without linking any C code) is used. It boils down to reading a few environment variables and converting them into raw file descriptors in a light wrapper.

A recording of socket activation in action, where execution of rad node status automatically starts the node: https://asciinema.org/a/R7N2N9JPvU8MMQh4LRD2FJQzW.

Note that socket activation is nothing specific to systemd. On OS X, launchd supports the same mechanism with a similar API. The JavaScript library node-socket-activation implements socket activation for both systemd and launchd.

See also:

lorenz pushed revision 2 b0f204a7 on base 064ece32 +130 -13 1 year ago

Rebase

lorenz pushed revision 3 7c4f92d4 on base 064ece32 +133 -13 1 year ago
fintohaps accepted 1 year ago

LGTM :)