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>
24 lines
606 B
Desktop File
24 lines
606 B
Desktop File
[Unit]
|
|
Description=PVE API Proxy Server
|
|
ConditionPathExists=/usr/bin/pveproxy
|
|
Wants=pve-cluster.service
|
|
Wants=pvedaemon.service
|
|
Wants=ssh.service
|
|
Wants=pve-storage.target
|
|
After=pve-storage.target
|
|
After=pve-cluster.service
|
|
After=pvedaemon.service
|
|
After=ssh.service
|
|
|
|
[Service]
|
|
ExecStartPre=-/usr/bin/pvecm updatecerts --silent
|
|
ExecStart=/usr/bin/pveproxy start
|
|
ExecStartPost=-sh -c '[ ! -e /var/log/pveam.log ] && /usr/bin/pveupdate'
|
|
ExecStop=/usr/bin/pveproxy stop
|
|
ExecReload=/usr/bin/pveproxy restart
|
|
PIDFile=/run/pveproxy/pveproxy.pid
|
|
Type=forking
|
|
Restart=on-failure
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|