Hello Martin,

thanks for the detailed info and the time spent on it

On Sat, 13 Apr 2024 15:05:41 +0200
Martin Steigerwald <mar...@lichtvoll.de> wrote:

> 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
> [...]
> 
> 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:
>[...]
> 
> 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.

OK, so if I undertand correctly we either export PATH in the
/etc/init.d/networking script or we export PATH both in stage 1 and 2
(so the script does not fail during boot and can be called during
runtime): is that correct?

If yes I think it's better to fix the networking script (ifupdown pkg)
so that the fix works for sysvinit users too.
Different story if multiple scripts fails during boot because of empty
PATH; many scripts in /etc/rc.S/ set their PATH but others don't..
Could you confirm that no other scripts fails in your container setup
when PATH is not exported in stage 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?
PATH is passed to env call for runsvdir, so I guess one can exec a bin
from local as runscript (not sure) without setting the PATH. I can't
think of other use cases..
I'm fine with removing, just a bit wary, I'm afraid to break some custom
setup

> 
> 
> 
> 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.

those files only work for runit stuff (runscripts and the sv trigger),
boot scripts are for sysvinit and do not obey to runit settings :(
perhaps it's time to roll some native runit bootscripts..
> 
> But that is for another time :)
> 
> Best,


Best regards,
Lorenzo

Reply via email to