I have checked it out, and even written and published library for integrating Erlang applications with systemd:
And using that I have created example Plug application:
Unfortunately this do not implement socket activation, yet, because gen_tcp
and gen_udp
require unbind(3)
ed file descriptors, and when you want socket activation then you (obviously) will get file descriptor that is already bound. However there is some hope in form of socket
module and moving from init
to it. When socket
will get a way to use existing file descriptors and there will be a way to “create” gen_{tcp,udp,sctp}
out of such existing socket
then it will be possible and I will try to extend the example to use it as well.
Right now the available features in the library are:
- Watchdog
- Notification socket
- Journal logging