:: Re: [DNG] OpenRC: was s6-rc, a s6-…
Etusivu
Poista viesti
Vastaa
Lähettäjä: Rob Owens
Päiväys:  
Vastaanottaja: dng
Aihe: Re: [DNG] OpenRC: was s6-rc, a s6-based service manager for Unix systems
----- Original Message -----
> From: "Steve Litt" <slitt@???>
>
> Am I the only person who doesn't like OpenRC? It can't respawn
> (supervise, whatever you call it). Its init scripts are every bit as
> complicated as those of sysvinit, but must be written in a special
> language that's confusingly almost but not quite /bin/sh. To be
> complete, therefore, it must spawn daemontools-encore or s6 to
> supervise things like dhcpd and wpa_supplicant.


One thing that I think is smart about OpenRC is the way variables
are set in a file other than the init script itself. If you want
to make some customizations, you don't edit the init script. You
edit the corresponding file in /etc/conf.d. It seems like this
could make maintaining scripts easier, and make them usable on a
wider variety of distros.

One thing I like about OpenRC and sysvinit is that they are shell
scripts. Shell script is a language that many sysadmins already
know. If they don't, they certainly wouldn't be wasting their time
by learning it. It is useful way beyond init systems.

If I wanted to automatically respawn something (and I might try
this on my MythTV backend which crashes every few months), I could
create this script:

#!/bin/sh
while true; do
    /start/my/daemon "$@"
done


My init system could call that script to start my daemon. Then to
stop the daemon it would have to kill both the script and the
daemon.

Some would call that an ugly hack, but it's also known as
flexibility. And it's one of the things I like about
shell-script-based init systems. I didn't even know how to do
this until 5 minutes ago, but I was able to search "linux
automatically respawn process". And I was handed a shell script.
Not a systemd script. Not an upstart script or a daemontools
script or a runit script.

My point is that shell script may be primitive by comparison to
the methods used by some other inits, but its power is in its
ubiquitousness.

By the way, I'm fairly new to OpenRC so I can't really recommend
it over other inits. I only intended to point out some things
that I consider strong points.

-Rob