:: Re: [DNG] RFH: runit-init
Pàgina inicial
Delete this message
Reply to this message
Autor: Steve Litt
Data:  
A: dng
Assumpte: Re: [DNG] RFH: runit-init
On Sat, 27 May 2017 00:15:16 +0200
Adam Borowski <kilobyte@???> wrote:

> Hi!
> Does anyone have a clue about runit?
>
> There's RC bug #861536 in Debian that's marked stretch-will-remove,
> and the maintainer can't currently fix it as he dared to not kowtow
> deep enough before Putin and is currently locked up in a nasty
> political case.
>
> While Debian is not Devuan, removal of alternative inits would hurt
> you pretty bad as there's no manpower to maintain all the init
> scripts, thus it's strongly in your interest to keep them at least
> present.
>
> I for one don't know anything about runit, and don't have the time
> right now. Would anyone care to help?
>
>
> Meow!


No sweat!

runit is one of those pieces of software so simple and so dependency
free that it's really better to install it outside of the distro.

Runit is two pieces: A PID1 that does little more than spawn a couple
rc files and then spin handling signals, and a process supervisor much
like daemontools.

More cool still, there's an easy, gentle way to ease your way into
runit. Back up your current sysvinit PID1: Actually back up the
computer just in case, and then download the runit tarball and install
as suggested. I personally suggest you let it default to installing
in /usr/local/bin and /usr/local/man.

If you care about stuff like runlevels, you need to make some symlinks.
Otherwise it's pretty straightforward and if you know daemontools you
pretty much know the supervision part of runit. After compiling, you
copy /etc/2 to /sbin/runsvdir-start, in that shellscript change the -P
argument of runsvdir to whatever directory you're using for your
symlink dir (most people don't want to create /service right off the
root), and put "SV:123456:respawn:/sbin/runsvdir-start" at the bottom
of /etc/inittab (I'm assuming you're using sysvinit).

Then, one by one, just shift your daemons from sysvinit via /etc/rc.d
to runit via a run script in a symlinked directory. Coolly, your
typpical 300 line sysvinit init file is replaced by a less than 10 line
run script. Run scripts are pretty much all the same once you really
get used to it.

I can help.

Later, when you've used runit as a daemontools substitute for awhile,
and want to let runit do your whole init, you can switch your grub to
init via runit-init, and build a good shutdown script as /etc/runit/3.
But that's a long way off: Get used to it as a supervision tool first.

SteveT

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