:: Re: [DNG] Apparently Jessie has run…
Page principale
Supprimer ce message
Répondre à ce message
Auteur: Steve Litt
Date:  
À: dng
Sujet: Re: [DNG] Apparently Jessie has runit
On Thu, 21 Jan 2016 21:34:31 -1000
Joel Roth <joelz@???> wrote:

> Steve Litt wrote:
> > On Wed, 20 Jan 2016 21:20:26 -1000
> > Joel Roth <joelz@???> wrote:
> > >
> > > Hi Steve,
> > >
> > > How complicated is it to port such scripts to runit? Exim4's
> > > init.d script is 275 lines.
> > >
> > > Joel
> >
> > Hi Joel,
> >
> > According to http://smarden.org/runit/runscripts.html#exim , Runit's
> > run script for Exim should be:
> >
> > =================================================
> > #!/bin/sh
> > exec /usr/local/sbin/exim -bdf -q30m
> > =================================================
>
> > Because the preceding doesn't contain "exec 2>&1", I would guess
> > that Exim does its own logging and doesn't need Runit to provide a
> > log for the Exim daemon.
> >
> Thanks. Yes I eventually stumbled on this. And as you say,
> it is possible to drill down through the init script to
> get just a few essential lines and environment settings.
>
> I guess the biggest problem is that I have 78 working init
> scripts, so it would be a gradual process to switch over to
> runit. I guess if I can start runit under sysvinit, I could
> move services one by one.


Exactly! I forgot to mention this, but you can use runit either as a
PID1 init to replace sysvinit, or as a daemontools-like process
supervisor that gets called from sysvinit's PID1. Instructions for
doing the latter are here:

http://smarden.org/runit/useinit.html

Joel, you were on the Debian-user list in the bad old days, so you
remember me saying that I always used djb's daemontools *in addition
to* sysvinit, and in fact regularly migrated S31_myservice type service
instantiation to daemontools for two reasons:

1) MUCH easier to understand what the heck is going on
2) Respawning

My point is that, even if one has no intention of ever using Runit as
PID1, a sysvinit/Runit hybrid is a very nice thing.

And of course, if you *do* intend to switch over to a full Runit init,
once you have all 78 or your services runitized, making the cutover is
a matter of making sure your /etc/runit/1 2 files are ready to
start early one-shot processes, and file 3 is ready to cleanly shut
down the computer. Then you just change the init= in your bootloader
from the sysvinit executable to the runit executable.

>
> Like you, I don't expect to run heavy-weight GUI
> environment, so I think a lot of fat could be cut away. Just
> that it's also running code ;-)
>
> I hope I can find time to fiddle with this.


Start by using Runit as a process supervisor started by sysvinit. I
predict you'll love it.

SteveT

Steve Litt
January 2016 featured book: Twenty Eight Tales of Troubleshooting
http://www.troubleshooters.com/28