packages: Add after-install target unit
Units that get installed via `rpm-ostree` on first boot cannot be enabled by ignition, because they do not exist when it runs `systemctl preset`. Thus, anything we want to start after its been installed needs to be explicitly started. To allow this in an extensible fashion, I've added an `after-install.target` unit and modified the `install-packages.sh` script to activate this unit once the installation is complete. The script also re-runs `systemctl preset`, so services will start automatically on subsequent boots.master
parent
9d941a9985
commit
ac6c31c5d8
|
@ -0,0 +1,2 @@
|
|||
[Unit]
|
||||
Description=Start services after package install
|
|
@ -6,3 +6,6 @@ if [ ! -d /etc/ignition/packages.d ]; then
|
|||
fi
|
||||
|
||||
cat /etc/ignition/packages.d/* | xargs rpm-ostree install --apply-live -y
|
||||
|
||||
systemctl preset-all --preset-mode=enable-only
|
||||
systemctl start after-install.target
|
||||
|
|
|
@ -14,6 +14,10 @@ storage:
|
|||
mode: 0644
|
||||
contents:
|
||||
local: install-packages.service
|
||||
- path: /etc/systemd/system/after-install.target
|
||||
mode: 0644
|
||||
contents:
|
||||
local: after-install.target
|
||||
|
||||
systemd:
|
||||
units:
|
||||
|
|
Loading…
Reference in New Issue