seapath / build_debian_iso

Code to build a debian seapath ISO file using FAI Project
https://lfenergy.org/projects/seapath/
Apache License 2.0
4 stars 7 forks source link

systemctl commands don't apply on target #109

Closed eroussy closed 2 months ago

eroussy commented 3 months ago

Somes services are disabled by the scripts of build_debian_iso (corosync,pacemaker, systemd-netword-wait-online ... ) Theses commands all fail when flashing a machine with this error : "System has not been booted with systemd as init system (PID: 1). Can't operate"

Steps to reproduce

insatomcat commented 3 months ago

It's just a normal warning since the nfsroot is working on a chrooted environment. The script still works: the service are properly disabled (the link files in /etc/systemd/system are removed).

dknueppe commented 2 months ago

Pretty sure I ran into this issue as well. I think I fixed it by manually creating a symlink in the correct location on the target, since thats effectively whats done when you enable the service. By manually I mean, have a script that exucutes after the FAI installation has the files in place, rather then a script that has 'systemctl enable ...' in it.

insatomcat commented 2 months ago

We could remove this warning by replacing those "systemctl disable.." by "rm -f /etc/systemd/system/multi-user.target.wants/..." But I was not fond of the idea of hardcoding the name of the target... that's why I prefered letting systemctl do its job. Yes it creates a warning, but the associated commands are still run so it still does work. We could also do some kind of "2>/dev/null" to hide the warning but once again since I know this warning is not a problem I tend not to care much about it.