packages: Fix service start on first boot
The *install-packages.service* unit has to be enabled, and the condition checking for `/etc/ignition/packages.installed` was inverted. Sending standard output to the console as well as the journal allows watching progress.master
parent
1cdd12454f
commit
9d941a9985
|
@ -1,17 +1,19 @@
|
||||||
# vim: set ft=systemd :
|
# vim: set ft=systemd :
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Install collectd
|
Description=Install additional packages
|
||||||
After=network-online.target
|
After=network-online.target
|
||||||
Wants=network-online.target
|
Wants=network-online.target
|
||||||
Before=zincati.service
|
Before=zincati.service
|
||||||
|
Before=systemd-user-sessions.service
|
||||||
ConditionPathExists=/etc/ignition/packages.d
|
ConditionPathExists=/etc/ignition/packages.d
|
||||||
ConditionPathExists=/etc/ignition/packages.installed
|
ConditionPathExists=!/etc/ignition/packages.installed
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
RemainAfterExit=yes
|
RemainAfterExit=yes
|
||||||
ExecStart=/bin/sh /etc/ignition/install-packages.sh
|
ExecStart=/bin/sh /etc/ignition/install-packages.sh
|
||||||
ExecStartPost=/bin/touch /etc/ignition/packages.installed
|
ExecStartPost=/bin/touch /etc/ignition/packages.installed
|
||||||
|
StandardOutput=journal+console
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
|
@ -14,3 +14,8 @@ storage:
|
||||||
mode: 0644
|
mode: 0644
|
||||||
contents:
|
contents:
|
||||||
local: install-packages.service
|
local: install-packages.service
|
||||||
|
|
||||||
|
systemd:
|
||||||
|
units:
|
||||||
|
- name: install-packages.service
|
||||||
|
enabled: true
|
||||||
|
|
Loading…
Reference in New Issue