3 ms·
> sysvinit is simple, and I didn't have any major issues with it. How do you encode service dependencies? If a service dies, what happens to services relying o
by ernst_klim 7y ago
> sysvinit is simple, and I didn't have any major issues with it.
How do you encode service dependencies? If a service dies, what happens to services relying on it on your system?
- csande17 7y agoAt least on my desktop machine, there aren't a whole lot of services that directly depend on other services. Usually, a service will provide some functionality (e.g. sound) used by applications I launch. As far as I know, systemd doesn't help with that, and I don't really want it to--imagine if systemd suddenly killed and restarted your browser! Also, maybe I'm just lucky (or using popular hardware, or something), but services on my machine don't just randomly die for no reason. NetworkManager, sshd, etc all seem pretty well-written and stable.
- ernst_klim 7y ago>As far as I know, systemd doesn't help with that It depends on the service in use and how is it defined. I have an embedded system in production, which have quite a complex graph of dependencies, some of which should be restarted on sudden death of others, some of which should persist anyways. Needless to say that systemd provides an incredible, robust and easy way of solving that, I had to write just a few 10-line long unit files for in-house software and use standard units provided by standard daemons. >imagine if systemd suddenly killed and restarted your browser Because your browsed doesn't rely on them. But my web interface definitely depends on NetworkManager, because it speaks to it via d-bus.
- csande17 7y agoTo clarify, by "systemd doesn't help with that", I meant "systemd does not attempt to manage, track service dependencies of, or restart applications I launch through my desktop's Applications menu or in a Terminal window". Which is a good thing! Even though my browser uses/"depends on" audio, I still don't want systemd to restart it without warning if PulseAudio dies.
- zaarn 7y agoYour browser can encode that it doesn't have to restart if pulse dies. Wants= will try to ensure Pulse is started but if Pulse cannot start or crashes, that's fine. Requires= will ensure pulse is started but doesn't do anything if it crashes. Only BindsTo= will stop the browser if pulse crashes.
- dbrgn 7y agoCheck out systemd socket activation. It's an awesome system that starts services on demand when they're needed by applications.