Package: runit-init
Version: 2.1.2-54
Severity: normal
X-Debbugs-Cc: mar...@lichtvoll.de

Dear Maintainer,

Hi!

I have Devuan Excalibur with Incus (forked from LXD) managed LXC
containers. reportbug said the package is unforked and thus I agreed
to send to Debian BTS instead.

All but one of them are Alpine Linux. In there I installed dhcpcd for
dual stack DHCP from Incus managed dnsmasq.

I am currently configuring myself a Devuan template starting from

incus launch images:devuan/daedalus zdevuan

I installed runit-init and socklog-run in there.

The containers comes up but dhcpcd is not running.

It should have been started by /etc/init.d/networking due to
/etc/network/interfaces:

auto eth0
iface eth0 inet dhcp

And indeed it is:

root@zdevuan:~# /etc/init.d/networking start
Configuring network interfaces...dhcpcd-9.4.1 starting
[…]

However even with:

root@zdevuan:~# cat /etc/boot.d/network
#!/usr/bin/env sh

/etc/init.d/networking start

it does not work.



I looked up how runit stage 2 runs init scripts. It does so by:

root@zdevuan:/etc# grep -r "rc2.d"
runit/2:                /lib/runit/async-timeout /lib/runit/run_sysv_scripts 
'/etc/rc2.d'

So I ran

/lib/runit/async-timeout /lib/runit/run_sysv_scripts '/etc/rc2.d'

manually and indeed it picks up /etc/boot.d/network:

root@zdevuan:~# /lib/runit/async-timeout /lib/runit/run_sysv_scripts 
'/etc/rc2.d'
dmesg: read kernel buffer failed: Operation not permitted
Not running dhcpcd because /etc/network/interfaces ... failed!
defines some interfaces that will use a DHCP client ... failed!
Configuring network interfaces...dhcpcd-9.4.1 starting
[…]

That last line is from /etc/boot.d/network.

Thus I tried to find out whether /etc/runit/2 actually runs those scripts
on boot:

 38         echo "$runsv_dir" 2>&1 >> /tmp/rc2.log
 39         ls -l /etc/runit/no.emulate.sysv 2>&1 >>/tmp/rc2.log
 40         if [ "$runsv_dir" != solo ] && [ ! -e /etc/runit/no.emulate.sysv ]; 
then
 41                 echo "run rc2.d scripts…" 2>&1 >>/tmp/rc2.log
 42                 /lib/runit/async-timeout /lib/runit/run_sysv_scripts 
'/etc/rc2.d' 2>&1 >>/tmp/rc2.log
 43         fi

This gives me:

root@zdevuan:~# cat /tmp/rc2.log 
default
run rc2.d scripts…
Not running dhcpcd because /etc/network/interfaces ... failed!
defines some interfaces that will use a DHCP client ... failed!
Configuring network interfaces...failed.

So indeed stage 2 runs the scripts. But it cannot configure the network
interface at this time. However running

/lib/runit/async-timeout /lib/runit/run_sysv_scripts '/etc/rc2.d'

later just works okay as shown above.

Also putting "/etc/init.d/networking restart" inside
"/etc/boot.d/network" does not work:

Running /etc/init.d/networking restart is deprecated because it may not 
re-enable some interfaces ... (warning).
Reconfiguring network interfaces...failed.

Not even putting

echo "ifdown eth0:"
ifdown eth0

echo "ifup eth0:"
ifup eth0

in there does work:

root@zdevuan:~# cat /tmp/rc2.log 
default
run rc2.d scripts…
Not running dhcpcd because /etc/network/interfaces ... failed!
defines some interfaces that will use a DHCP client ... failed!
ifdown eth0:
ifup eth0:

No output from "ifup eth0" which does not seem right.

However "ifdown eth0" and "ifup eth0" just works fine after booting. But
even if I insert a "sleep 10" before those, it still does not work.



I also looked for how rcS.d scripts are executed by Runit stage 0:

root@zdevuan:/etc# grep -r "rcS.d"
[…]
runit/1:        for script in /etc/rcS.d/S* ; do


In there I added for debugging:

 11         for script in /etc/rcS.d/S* ; do
 12                 path=$(realpath "$script")
 13                 name=${path##*/}
 14                 [ -e "/etc/runit/no.emulate.sysv.d/$name" ] && continue
[…]
 19                 echo "run $script" >>/tmp/rcS.log
 20                 "$script" start --force-sysv 2>&1 >>/tmp/rcS.log
 21         done

And indeed stage1 runs the scripts. But configuring network interfaces
fails there as well:

root@zdevuan:~# cat /tmp/rcS.log 
run /etc/rcS.d/S08mountall.sh
Mounting local filesystems...done.
Activating swapfile swap, if any...done.
run /etc/rcS.d/S09mountall-bootclean.sh
Cleaning up temporary files....
run /etc/rcS.d/S10brightness
run /etc/rcS.d/S10procps
Starting Setting kernel variables: sysctl is already running.
run /etc/rcS.d/S10stop-bootlogd-single
run /etc/rcS.d/S10urandom
run /etc/rcS.d/S11networking
Configuring network interfaces...failed.
run /etc/rcS.d/S12mountnfs.sh
run /etc/rcS.d/S13mountnfs-bootclean.sh
Cleaning up temporary files....
run /etc/rcS.d/S14bootmisc.sh


However as bootlogd is not being started and would not work inside
an LXC container anyway, I am not sure I can see any logging:

root@zdevuan:~# /etc/init.d/bootlogd start
Starting boot logger: bootlogdbootlogd: ioctl(/dev/pts/2, TIOCCONS): Operation 
not permitted


Any idea how to find the cause of what is happening here?

Best,
-- 
Martin

-- System Information:
Devuan Release: Excalibur aka version 6 I think
Debian Release: 13.0
Architecture: amd64 (x86_64)

Kernel: Linux 6.6.15-amd64 (SMP w/4 CPU threads; PREEMPT)
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: runit (via /run/runit.stopit)

Versions of packages runit-init depends on:
ii  getty-run    2.1.2-54
ii  initscripts  3.06-4devuan3
ii  insserv      1.24.0-1
ii  mount        2.38.1-5+deb12u1devuan1
ii  runit        2.1.2-54

Versions of packages runit-init recommends:
ii  runit-services  0.5.5~deb12u1

runit-init suggests no packages.

-- no debconf information

Reply via email to