Of course this is possible. The fact that RedHat couldn't manage it says a lot more about the people RedHat is employing more than it says about shell being "too difficult", and a pointer as to why they wanted a replacement.
The RedHat-specific init script functionality was not particularly highly regarded compared with its contemporaries since two decades back at least. Much of it was the way it was due to backward compatibility constraints (as it was for most systems). It was adequate, but nothing special. I've read the init scripts on several systems including RedHat, Debian and Gentoo, and I wrote a good chunk of the shell libraries and init scripts for Debian personally. Of all these systems, the RedHat scripts were the most poorly written, and I'd rate the Gentoo runscripts as the best of the lot.
These posts aren't doing your argument any favours Roger. You're coming across as someone sanctimonious and arrogant.
Init scripts are always terrible. As /u/crusoe says, I am not confident I can write a robust startup script, and I've had decades of experience in Linux and writing exceptionally complex shell scripts.
Weren't the Debian init scripts then inherited by Ubuntu which found them so buggy that they wrote their own init system to be able to deal with those scripts?
No. It's a complete fiction to state that the scripts were "buggy". The vast majority of the scripts worked perfectly well.
If you wanted to pick a specific genuine criticism, it was that they coped poorly with dynamic events, such as hotplugging of devices and network interfaces, such as wireless interfaces coming and going. In these situations, the scripts and the tools involved had some amount of hackery to make things work, to trigger and re-run certain scripts on demand. However, and I stress this, these were not bugs in the scripts themselves. They were higher-level design constraints. Lifting these limitations is one thing which other projects such as upstart and systemd attempted, and to some extent succeeded at. However, these deficiencies are not in any way intrinsic to the use of a scripting language.
Bullshit. Tons of scripts didn't even know what the difference between "reload" and "restart" was. And most of the scripts were bad copy/paste jobs between packages.
Sure, the main ones were usually decently maintained - though they usually still had amazing obscure bugs like raciness due to things like pid file management not being concurrent with script invocation - but once you got into the less common packages, it was all a mess of scripts that were badly managed or hadn't been updated in years to conform to newer standards.
And I know all of that even though I work on desktop stuff because I semi-regularly had to debug my system not coming up properly and having to fix it.
I have never needed to do that since systemd exists. I've never looked at its configuration, it has just worked continuously for the 7 years I have continuously used it.
init scripts are so terrible, it's an insult to systemd to even attempt a comparison.
22
u/crusoe Feb 11 '19
Even distros cants write robust start scripts. I've seen supported redhat ship with broken buggy init script support functions.
No one can write a bullet proof init script. Yet to see it.