Sysemd in the nfsroot

Justin Cattle j at ocado.com
Tue May 10 21:45:24 CEST 2022


Hi Thomas,


I found a bit of time to take a look.

I have forked and created a branch with a demo of how it could work.  It's
not meant to be the finished article, but hopefully it shows how some of it
could be achieved.

Things to note:

   - Relevant part of NFSROOT config needs to be something like this:
      - systemd systemd-sysv libpam-systemd sysvinit-core-
   - Because of potential race conditions with starting usual tty services,
   I select unused tty for this
      - fai on tty11
      - fai-maint on tty12
   - fai-maint is a systemd service which creates a tty with a root bash
   session already logged in.  It's just an example of how that kind of thing
   could be achieved with systemd.
   - Although I tried to make FAI itself still support both SysV and
   Systemd, it's hard to do that in the packaging I think, so for this I
   dropped SysV support in the packaging.
      - You can use the systemd-sysv compatibility layer to create service
      units, but that doesn't give as much control over the units [
they are much
      more basic ], so native systemd is better.


Please also note I haven't tested this exhaustively, so far I've only used
it with a squashfs image, not an nfs root.

I'd be happy to work with you to create a PR and review it together to try
and integrate it, but I appreciate you may not want to look at this yet.
It seems to be that multi init system packaging could be the trickiest
part, and you may not want to drop SysV support any time soon.

Please take a look and let me know what you think:
https://github.com/ocadotechnology/fai/tree/systemd-support


Cheers,
Just


On Fri, 6 May 2022 at 20:40, Thomas Lange <lange at cs.uni-koeln.de> wrote:

> Hi Justin,
>
> I didn't had time to work on this yet. I do not know how to call the
> main fai script from systemd, so its output is shown on the console
> and the input is also read from the console. It must also work that
> the admin can interrupt the fai run via ctrl-C and get an interactive
> shell.
> Does anyone know how to do this?
>
> Currently (using sysv init) the script is started as /etc/init.d/rcS
> and starts some other daemons on demand (for e.g. sshd is only started
> if FAI_FLAGS includes sshd). How do we do this using systemd?
>
>
> >>>>> On Fri, 6 May 2022 15:02:30 +0100, Justin Cattle <j at ocado.com> said:
>
>     > Hi,
>     > I'm just wondering what the current blockers to using systemd in the
> nfsroot are.  Are there some things that simply won't work, or is it more
> about reducing complexity by only supporting
>     > a single init system, or something else ?
>
>
> --
> best regards Thomas
>

-- 


Notice: 
This email is confidential and may contain copyright material of 
members of the Ocado Group. Opinions and views expressed in this message 
may not necessarily reflect the opinions and views of the members of the 
Ocado Group.

If you are not the intended recipient, please notify us 
immediately and delete all copies of this message. Please note that it is 
your responsibility to scan this message for viruses.

References to the 
"Ocado Group" are to Ocado Group plc (registered in England and Wales with 
number 7098618) and its subsidiary undertakings (as that expression is 
defined in the Companies Act 2006) from time to time. The registered office 
of Ocado Group plc is Buildings One & Two, Trident Place, Mosquito Way, 
Hatfield, Hertfordshire, AL10 9UL.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.uni-koeln.de/pipermail/linux-fai/attachments/20220510/536836b0/attachment.html>


More information about the linux-fai mailing list