How systemd knows about application state? We have a sd_notify syscall that we might use. There're 2 libraries that implements via cython this syscall:
So now let's have some fun with it. Enter sd-notify-python directory and follow those steps:
- sd-notify:
- view sd-notify-app-service.service file
- copy service file to /etc/systemd/system/ and enable/run it
- view journalctl -f -u sd-notify-app-service
- systemd-notify + socket activation
- view systemd-notify-app.service and systemd-notify-app.socket
- copy service and socket file to /etc/systemd/system/
- start systemd-notify-app.socket service
- curl localhost:1025 && journalctl -f
Remember about reading socket activation posts: