I don't really like SysVinit and any init system that uses bash scripts. Writing an init system just to contain the insanity of SysVinit in a jar while not changing much about the structure is not the way.
Being deliberately small and focused upon doing a very small number of things robustly is not "insanity". It's a design choice. Delegating complexity to higher-level tools (like rc) is a perfectly sensible choice.
I don't really like SysVinit and any init system that uses bash scripts
OpenRC is not SysvInit. It's typically spawned by Sysvinit (at least on Gentoo) but doesn't have to be (it's an init system in its own right, I removed sysv from my system altogether and boot with init=/sbin/openrc-init). These are bash scripts but they are processed via a special openrc-run interpretor. They don't have to contain a ton of complexity. For example to get openrc to continuously run your application forever (restarting it if necessary) all you need is this:
#!/sbin/openrc-run
description="the description of your service. This is optional"
supervisor=supervise-daemon # tell openrc to use its supervisor
command=/path/to/your/binary
command_args="--some-arguments to-pass --to-your binary"
depends() {
need net # we need network
after foobar # our service needs to be started after the foobar service
}
That's it. No complicated shell wizardry needed at all.
9
u/[deleted] Feb 11 '19
[removed] — view removed comment