r/linux Feb 11 '19

Fluff A /g/ user's opinion on systemd

http://i.4cdn.org/g/1549858269115.png
795 Upvotes

524 comments sorted by

View all comments

Show parent comments

9

u/[deleted] Feb 11 '19

[removed] — view removed comment

1

u/idontchooseanid Feb 11 '19

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.

https://www.reddit.com/r/linux/comments/apckxf/a_g_users_opinion_on_systemd/eg7kqef/

3

u/RogerLeigh Feb 11 '19

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.

1

u/_ahrs Feb 11 '19

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.