ca0fc07dd4
Add a simple ExecStartPre command which reads the local node config, and if a delay is set the helper sleeps that long then exists. The systemd-unit approach was chosen as this ensures that we really only delay when doing the startall on node boot. The pve-guests service does not allows manual stops, starts or restarts, it can only be pulled in by the multi-user.target Mark this command with "-" to tell systemd that errors of it should not cause an abort, it's a best-effort approach. The journal from a 2 second delay would look like: > Nov 19 13:13:48 dev6 systemd[1]: Starting PVE guests... > Nov 19 13:13:48 dev6 pve-startall-delay[2318]: Delaying on-boot 'startall' command for 2 second(s). > ... > Nov 19 13:13:50 dev6 pve-guests[2339]: <root@pam> starting task UPID:dev6:00000924:00000529:5DD3DC7E:startall::root@pam: Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
31 lines
782 B
Desktop File
31 lines
782 B
Desktop File
[Unit]
|
|
Description=PVE guests
|
|
ConditionPathExists=/usr/bin/pvesh
|
|
RefuseManualStart=true
|
|
RefuseManualStop=true
|
|
Wants=pvestatd.service
|
|
Wants=pveproxy.service
|
|
Wants=spiceproxy.service
|
|
Wants=pve-firewall.service
|
|
Wants=lxc.service
|
|
After=pveproxy.service
|
|
After=pvestatd.service
|
|
After=spiceproxy.service
|
|
After=pve-firewall.service
|
|
After=lxc.service
|
|
After=pve-ha-crm.service pve-ha-lrm.service
|
|
|
|
[Service]
|
|
Environment="PVE_LOG_ID=pve-guests"
|
|
ExecStartPre=-/usr/share/pve-manager/helpers/pve-startall-delay
|
|
ExecStart=/usr/bin/pvesh --nooutput create /nodes/localhost/startall
|
|
ExecStop=-/usr/bin/vzdump -stop
|
|
ExecStop=/usr/bin/pvesh --nooutput create /nodes/localhost/stopall
|
|
Type=oneshot
|
|
RemainAfterExit=yes
|
|
TimeoutSec=infinity
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|
|
Alias=pve-manager.service
|