Re: Journey to s6-svscan as PID 1 on FreeBSD (almost there)

From: Dewayne Geraghty <dewayne.geraghty_at_heuristicsystems.com.au>
Date: Fri, 9 Apr 2021 14:43:03 +1000

On 9/04/2021 4:29 am, Crest wrote:

> There is a cleaner solution. I prefer to set the init_path kernel env
> var in /boot/loader.conf and prepend the s6 stage1 script to the normal
> search path. That way the kernel starts my execline script as PID 1 and
> if I mess it I just have to clear the variable from the loader prompt.

Thank-you for the reminder, I'd forgotten about kern.init_path.
Though in both cases its really a matter of changing a variable after
the loader has completed its chores (For non-FreeBSDers, there are two
points where a boot can be interrupted prior to the kernel starting)

I use both init_script to establish all the prerequisite stuff, check
boot device, enable MAC(biba), enable firewall, start network, start
ssh, create logging environment; then handoff to s6-svscan, via
init_exec. Yes it could be done in one script which init_path points
to, and I agree that would be cleaner. But the prerequisite stuff
really needs a sh, and I like execlineb doing its redirection prep and
handing off to s6-svscan :)
Received on Fri Apr 09 2021 - 04:43:03 UTC

This archive was generated by hypermail 2.3.0 : Sun May 09 2021 - 19:38:49 UTC