[lxc-users] LXC Slackware Container - runit
Matteo Bernardini
matteo.bernardini at gmail.com
Tue Sep 18 18:54:03 UTC 2018
Il giorno mar 18 set 2018 alle ore 13:30 spaceman
<spaceman at antispaceman.com> ha scritto:
>
> Hi,
>
> Matteo Bernardini wrote:
> >this is not related to LXC, this behaviour is the same outside of a
> >container: you have to use the Slackware standard way to add
> >additional services at startup and shutdown.
> >
> >runit_start () {
> > /usr/bin/runsv /service
> >}
> >
>
> Yes that works, but try this instead:
>
> runit_start () {
> /usr/bin/runsv /service &
> }
>
> allowing both rc.runit and rc.local to finish (unless you want bash
> running continously), however runsv just exits without a trace. This
> works with several other of my rc scripts.
>
> In bash '&' normally means background the process, but here the process
> just disappears (with no output or exit code).
>
> Using your script none of the rest of rc.local after you start rc.runit
> will be executed until rc.runit stops.
that happens because, from what I have read on the matter (I am a
first timer with it), runit wants to stay in foreground: I had
provided general instructions for daemons in my first reply but this
doesn't seem to apply cleanly to runsv.
according to the official documentation
http://smarden.org/runit/useinit.html
your best option, as Slackware uses an hybrid init system (bsd +
sysinit), seems to be adding to /etc/inittab the line
SV:123456:respawn:/sbin/runsvdir-start
with a /service main directory containing other subdirectories for the
various services.
I don't know how you installed runit but /sbin/runsvdir-start is
provided in the package generated from the SlackBuild available at
slackbuilds.org
https://slackbuilds.org/repository/14.2/system/runit/
Matteo
More information about the lxc-users
mailing list