[modular-debian] Re: Epoch Init System Howto

  • From: Steve Litt <slitt@xxxxxxxxxxxxxxxxxxx>
  • To: modular-debian@xxxxxxxxxxxxx
  • Date: Tue, 30 Dec 2014 20:13:40 -0500

On Tue, 30 Dec 2014 13:13:02 -1000
Joel Roth <joelz@xxxxxxxxx> wrote:

> On Tue, Dec 30, 2014 at 03:28:06PM -0500, Steve Litt wrote:
> > Hi all,
> > 
> > Here's a new Epoch Init System howto, with which any reasonably
> > knowledgeable Linux user can replace his or her current init system
> > with Epoch:
>  
> > http://www.troubleshooters.com/linux/init/manjaro_experiments.htm#pure_epoch_init_system
> > 
> > Hope you like it.
> 
> Thanks for this valuable guide!!!  I found it very easy to
> read.
> 
> Epoch raises a question. Should I *need* to be able to
> replace init scripts on upgrading upgrading?
> Debian has infrastructure for it. But an admin-configured
> init system such as Epoch cuts out large swaths of 
> that complexity.
> 
> I can see how from the distro developer's view, being able
> to upgrade init scripts with the package it belongs to is
> beneficial.
> 
> Joel

Hi Joel,

Happy New Year to you and all lovers of choice!

You've touched upon an interesting topic. Init scripts are an
intersection of three thing:

1) The init system
2) The app being managed (sshd or crond or whatever)
3) The admin's preferences

Note that in #2, some apps are most associated with the distro, like
devfs, sysfs, maybe udev. The init scripts for those would certainly
need changing with new distro versions.

But the others: sshd, crond, dovecot, httpd, postfix, those should
change only when the interface to "upstream" program changes. If it's
otherwise, I think perhaps the program in question has bitten off more
than it could chew, or the distro packagers have tried too hard to tie
things together that should have been left to the admin.

One thing shines through, however, and that one thing was something the
systemd fans were right about: There's no place in initland for overly
complex init scripts such as those for sysvinit and OpenRC. Those crazy
scripts just beg the distros to "do it all for you".

To see a script-using init that gets it right, look at runit. At
http://smarden.org/runit/faq.html#depends, see how amazingly simple the
script is to start cron only after socklog-unix has started. That's how
scripts should look.

Interestingly enough, even sysvinit scripts are based on sanity, it's
just that somehow the distros fill them with craziness. See this:

http://www.sensi.org/~alec/unix/redhat/sysvinit.html

The preceding link shows a perfectly sane framework for an init script.
Tell it the command to start, the command to stop, and how to reload
it. No big deal, right? I think the problem is that the distros load
this framework with all sorts of edge case nonsense better handled by
a separate program. The package, upon installation, should fix all the
edge cases so they don't need to be reiterated in the init script.
Also, if it looks like the init script is going to get too crazy, why
not put the bulk of it in a separate shellscript?

SteveT

Steve Litt                *  http://www.troubleshooters.com/
Troubleshooting Training  *  Human Performance


Other related posts: