node: Socket Activation with systemd
This implements socket activation for radicle-node by cooperating with systemd. It is an alternative to patch b25bed2, which uses libsystemd to achieve the same goal. Only one of the two patches should be accepted.
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:
man:sd_listen_fds(3)- Crate
libsystemd - Crate
raunch(analogue for launchd) - https://0pointer.net/blog/projects/systemd.html
- https://0pointer.de/blog/projects/socket-activation.html
- https://0pointer.de/blog/projects/socket-activation2.html
- https://github.com/moby/moby/pull/3105
- https://github.com/sorccu/node-socket-activation
- https://mgdm.net/weblog/systemd-socket-activation/
6 files changed
+121
-13
6f8d75a0
→
723e2741
modified Cargo.lock
@@ -2227,6 +2227,7 @@ dependencies = [
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -2293,6 +2294,10 @@ dependencies = [
|
|
|
|
|
|
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
modified Cargo.toml
@@ -14,6 +14,7 @@ members = [
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -26,6 +27,7 @@ default-members = [
|
|
|
|
|
|
| + | |
|
|
|
|
|
modified radicle-node/Cargo.toml
@@ -9,6 +9,8 @@ edition = "2021"
|
|
|
|
|
|
| + | |
| + | |
|
|
|
|
|
@@ -56,6 +58,11 @@ version = "0"
|
|
|
|
|
|
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
modified radicle-node/src/runtime.rs
@@ -88,11 +88,19 @@ pub enum Error {
|
|
|
|
|
|
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -256,15 +264,7 @@ impl Runtime {
|
|
|
|
|
|
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| + | |
|
|
|
|
|
@@ -281,13 +281,16 @@ impl Runtime {
|
|
|
|
|
|
| + | |
| + | |
| + | |
| + | |
|
|
|
|
| - | |
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -303,10 +306,53 @@ impl Runtime {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
|
|
|
|
|
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
added radicle-systemd/Cargo.toml
@@ -0,0 +1,7 @@
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
added radicle-systemd/src/lib.rs
@@ -0,0 +1,41 @@
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |