3 ms·
The messier part of the old sysinit V was dependency handling, LSB headers are just an horrible hack and do a very poor job at it. However, imho, shell scripts
by kakwa_ 10y ago
The messier part of the old sysinit V was dependency handling, LSB headers are just an horrible hack and do a very poor job at it.
However, imho, shell scripts are great for that kind of work. Services come in all sort of shapes, some are proper daemons (fork, cd /, close([stdin, stdout, stderr]) and the rest), some are a little worse to say the least. And more often than not, the later is your super business critical important app built in house by incompetent developers.
The point being that services comes in all forms and shapes, and having a scripting language for integrating them and, if needed, compensating for crappy software is extremely useful.
Another aspect is that programs contain bugs, and the more complex a program is, the more bugs it contains. Keeping PID 1 as simple as possible should be a goal, nobody needs an http server inside its init system (or a dhcp client, or a dns resolver or...).
For some years now, the Gentoo Project has OpenRC/runscript (specialized shell for init scripts). It works really really well and it's quite simple to write an init script in it. It's a bit sad that it wasn't more considered in other distributions.
- justinsaccount 10y ago> proper daemons (fork, cd /, close([stdin, stdout, stderr]) and the rest), some are a little worse to say the least. And more often than not, the later is your super business critical important app built in house by incompetent developers. "proper daemons" are broken by design. Perhaps your "incompetent developers" know something that you don't? https://cr.yp.to/daemontools/faq/create.html https://cr.yp.to/daemontools/faq/create.html How can I supervise a daemon that puts itself into the background? When I run inetd, my shell script exits immediately, so supervise keeps trying to restart it. Answer: The best answer is to fix the daemon. Having every daemon put itself into the background is bad software design.
- bjourne 10y agoAre you saying that there are a lot of daemons out there that doesn't fit into systemd's declarative architecture? If so, the daemons could be fixed or systemd could be extended to cater for "not perfectly written" daemons. On the other hand if the daemon is written by incompetent developers and is doing very stupid stuff then it is a good thing that it doesn't fit. The developers will have an incentive to fix their broken code. And even with systemd it is possible to run arbitrary shell scripts at startup (afaik) which could start the daemon so they aren't totally out of luck. > For some years now, the Gentoo Project has OpenRC/runscript (specialized shell for init scripts). But is a scripting language really needed for daemon management? If the answer is no, then a more limited configuration language (systemd's .service files) is better.
- tete 10y agoI agree on OpenRC. OpenRC is a great, simple, portable solution that really solves the problem without introducing new ones. What I think is that we see an extreme case of "Not Invented Here". To be honest, OpenRC (at times) was displayed as Gentoo-Only-Project, despite being very portable. I however want to highlight another general purpose Linux distribution that seems to be kicking along well (ie. not just being an anti-systemd distribution) and uses OpenRC. Alpine Linux: https://alpinelinux.org/ https://alpinelinux.org/ I have seen it being used and worked with people who have been using it for a while. I never really got into it myself - lack of time being the reason.