diff --git a/.obs/specfile/elemental.spec b/.obs/specfile/elemental.spec index d4f5be95e..125adb454 100644 --- a/.obs/specfile/elemental.spec +++ b/.obs/specfile/elemental.spec @@ -77,18 +77,22 @@ rm -rf %{buildroot}/usr/libexec/.placeholder %pre %service_add_pre elemental-populate-node-labels.service %service_add_pre shutdown-containerd.service +%service_add_pre elemental-register.service %post %service_add_post elemental-populate-node-labels.service %service_add_post shutdown-containerd.service +%service_add_post elemental-register.service %preun %service_del_preun elemental-populate-node-labels.service %service_del_preun shutdown-containerd.service +%service_del_preun elemental-register.service %postun %service_del_postun elemental-populate-node-labels.service %service_del_postun shutdown-containerd.service +%service_del_postun elemental-register.service %files %defattr(-,root,root,-) @@ -104,6 +108,7 @@ rm -rf %{buildroot}/usr/libexec/.placeholder %config %{_sysconfdir}/NetworkManager/conf.d/rke2-canal.conf %dir %{_unitdir} %{_unitdir}/shutdown-containerd.service +%{_unitdir}/elemental-register.service %{_unitdir}/elemental-populate-node-labels.service %{_sbindir}/elemental-populate-node-labels %dir /usr/libexec diff --git a/framework/files/system/oem/05_motd_and_autologin.yaml b/framework/files/system/oem/05_motd_and_autologin.yaml index b83c51527..7e99b3cbd 100644 --- a/framework/files/system/oem/05_motd_and_autologin.yaml +++ b/framework/files/system/oem/05_motd_and_autologin.yaml @@ -7,7 +7,7 @@ stages: content: | Installation is in progress. - You can "journalctl -f -t elemental" to view progress + You can "journalctl -f -u elemental-register" to view progress permissions: 0644 - path: /etc/systemd/system/serial-getty@ttyS0.service.d/override.conf diff --git a/framework/files/system/oem/99_elemental-register.yaml b/framework/files/system/oem/99_elemental-register.yaml index bc355b409..8e75f4d22 100644 --- a/framework/files/system/oem/99_elemental-register.yaml +++ b/framework/files/system/oem/99_elemental-register.yaml @@ -4,4 +4,4 @@ stages: # run only if on live cd and there is a config file - if: '[ -f /run/cos/live_mode ] && [ -f /run/initramfs/live/livecd-cloud-config.yaml ]' commands: - - systemd-cat -t elemental elemental-register --debug /run/initramfs/live/ + - systemctl start elemental-register.service diff --git a/framework/files/usr/lib/systemd/system/elemental-register.service b/framework/files/usr/lib/systemd/system/elemental-register.service new file mode 100644 index 000000000..2b067f325 --- /dev/null +++ b/framework/files/usr/lib/systemd/system/elemental-register.service @@ -0,0 +1,10 @@ +[Unit] +Description=Elemental Register +Documentation=https://elemental.docs.rancher.com +Wants=network-online.target +After=network-online.target + +[Service] +Type=oneshot +ExecStart=bash --login -c "elemental-register --debug /run/initramfs/live" +