pveproxy service: use heuristic to trigger initial appliance update

Our timer won't be triggered automatically on initial boot if the
current date is to near on the next scheduled run, and while it would
be nicer to create a dedicated service with a ConditionFirstBoot, this
seems a bit overkill for now, so just check if the pveam log exists,
and if not trigger a daily update, which will generate such a log.

Do so after pveproxy started in ExecStartPost and allow this to fail
by prefixing the call with -.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2025-08-05 11:48:15 +02:00
parent 767bac6324
commit f1ce32103f

View file

@ -13,6 +13,7 @@ After=ssh.service
[Service] [Service]
ExecStartPre=-/usr/bin/pvecm updatecerts --silent ExecStartPre=-/usr/bin/pvecm updatecerts --silent
ExecStart=/usr/bin/pveproxy start ExecStart=/usr/bin/pveproxy start
ExecStartPost=-sh -c '[ ! -e /var/log/pveam.log ] && /usr/bin/pveupdate'
ExecStop=/usr/bin/pveproxy stop ExecStop=/usr/bin/pveproxy stop
ExecReload=/usr/bin/pveproxy restart ExecReload=/usr/bin/pveproxy restart
PIDFile=/run/pveproxy/pveproxy.pid PIDFile=/run/pveproxy/pveproxy.pid