4 ms·
The main issue with systemd is UX. The config files needs too many knobs for simple run-forever-in-background use cases and half of the time you get weird permi
by sansnomme 7y ago
The main issue with systemd is UX. The config files needs too many knobs for simple run-forever-in-background use cases and half of the time you get weird permission issues related to sudo. Documentation feels half baked and requires digging through manpages. A pm2-style init in Rust would be a lot better.
- jononor 7y agoWhat is wrong with it exactly? A typical unit file would for something that runs forever is something like this: [Unit] Description=This service runs always [Install] WantedBy=multi-user.target [Service] ExecStart=/usr/bin/python3 /opt/myapp/main.py Restart=always WorkingDirectory=/opt/myapp User=myuser Group=myuser You can skip the last 3 if you want.
- Arnavion 7y agoIf main.py crashes ~5 times within ~10 seconds, then it'll get put in a failed state until you manually recover it with `reset-failed`. systemd will be happy to restart it often enough that it hits that threshold, because you told it to. So just `Restart=always` isn't enough; you need to set `StartLimitBurst` too (and `StartLimitIntervalSec` if you want to fine-tune it).
- jjoonathan 7y agoThe systemd unit file isn't a cluster of half-baked utilities held together with spit and bailing wire, so naturally people hate it.
- gsich 7y agoOn the contrary, it's surprisingly easy to create such a thing. You get logging for free too.