noflo / noflo-nodejs

Command-line tool for running NoFlo programs on Node.js
91 stars 36 forks source link

Support for autostarting using systemd socket activation #101

Open jonnor opened 7 years ago

jonnor commented 7 years ago

One generally has several projects made with NoFlo. And when switching between them in Flowhub, one needs to set up the corresponding runtime (usually node-nodejs) in the right directory, before one can connect to it. However, with systemd socket activation a service can be started (and then stopped after a time) when traffic comes in on a port, for instance from Flowhub. http://0pointer.de/blog/projects/socket-activation.html

systemd provides some C APIs for this, accessible for instance via https://github.com/rubenv/node-systemd However, it sounds like that may not be neccesary, as systemd also sets LISTEN_FDS envvar, and then file descriptor 3 is the one to use. https://github.com/rubenv/node-systemd/issues/12#issuecomment-85501926

jonnor commented 7 years ago

Might also want a systemd .service unit generator, like https://github.com/msgflo/msgflo/issues/20