Why do OpenRC, runit, Sysvinit not Use Config File as Their Init Script Like Upstart/systemd?
Why do they use Shell?
Sorry for bad English. English isn't my native languange
Why do they use Shell?
Sorry for bad English. English isn't my native languange
The script-based systems came first. They had to evolve into the amalgamation of pitfalls that they have become for someone to abstract out their important concepts into something that could use configuration files.
While shell based RC systems do offer flexibility they also have downsides including copy and paste leading to subtly different behaviour across units. Dependency resolution was also a bit of a hack on top of scripts to deal with concepts like run levels.
The declarative approach of a proper configuration is a better and more scalable solution.
I think in *nix, shell-configured init systems came first and the non-shell config file init systems are a more recent development. The real question is why the non-shell-configured init systems decided to change it up.
I'm far from an expert in init systems, but there are some benefits to declarative approaches for configuration. It's one of the main reasons yaml and toml are as popular as they are. The short version is, declarative configuration tends to be less verbose, and the declarative contract defines what state you want things to be in, not how to get there which makes it easier on the person writing the unit file, and on the implementers of systemd in that there's a smaller surface-area to test
Generally declarative:
The declarative approach also allows for better composability - user tweaks can just be the relevant lines on top of the packaged default config.
Shell scripts work well for simple portable programmability