Martin Steigerwald - 13.04.24, 14:32:16 CEST:
> Any idea how to find the cause of what is happening here?

I found the cause:

The container starts out with an almost empty environment. In
/etc/runit/1 I added lines 4 to 6:

  1 #!/bin/sh
  2 # system one time initialization tasks
  3 
  4 echo ">> environment" >> /tmp/rcS.log
  5 /usr/bin/env >> /tmp/rcS.log
  6 echo ">> end of environment" >> /tmp/rcS.log
  7 
  8 PATH=/sbin:/usr/sbin:/bin:/usr/bin

(For some reason using /tmp/rcS.log did not give me any output. Although
/tmp is not mounted elsewhere during the boot process.)

This gives me:

root@zdevuan:~# cat rcS.log 
>> environment
container=lxc
PWD=/
>> end of environment

No PATH defined.

The script defines it. See line 8 in my changed script. However it does not 
export it. Thus adding line 9 fixes the bug I reported:

  8 PATH=/sbin:/usr/sbin:/bin:/usr/bin
  9 export PATH

The network is configured just fine after adding that line.



Same goes for stage 2. In /etc/runit/2 I added:

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

Which gives me:

>> environment
container=lxc
PWD=/
>> end of environment

Exporting the PATH there as well like

  1 #!/bin/sh
  2 
  3 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/usr/sbin:/bin:/usr/bin
  4 export PATH
  5 SVDIR=/etc/service

fixes

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

/etc/init.d/networking restart

The network is configured even without the "export PATH" fix in
/etc/runit/1.

I just wonder why stage 2 contains /usr/local bin directories. I think
that should not be the case. Shall I report this as a different issue?



I am now undoing my debug output.

I think I could provide a merge request for the fixes at a later time.
For now I like to finish the Devuan template and actually use it.

That bootlogd does not seem to work inside a container is a different
issue I may report at another time.

I added empty "debug" and "verbose" files in /etc/runit but did not
find any debug output. Maybe those files needed to have some content.
Maybe it requires bootlogd.

But that is for another time :)

Best,
-- 
Martin

Reply via email to