2019-07-05 22:22:28 -04:00
#!/bin/sh
2019-07-06 01:48:45 -04:00
# Reload systemd's view of the units
systemctl daemon-reload
2020-02-15 22:10:34 -05:00
# Restart the main daemon and apply database migrations (or warn on first install)
2020-02-08 19:16:19 -05:00
if systemctl is-active --quiet pvcapid.service; then
2020-02-15 22:10:34 -05:00
systemctl stop pvcapid.service
/usr/share/pvc/pvc-api-db-upgrade
systemctl start pvcapid.service
2021-10-03 15:15:26 -04:00
fi
# Restart the worker daemon
2023-11-15 19:13:48 -05:00
if systemctl is-active --quiet pvcworkerd.service; then
systemctl stop pvcworkerd.service
systemctl start pvcworkerd.service
2021-10-03 15:15:26 -04:00
fi
2021-10-19 00:27:12 -04:00
if [ ! -f /etc/pvc/pvcapid.yaml ]; then
2023-11-15 19:13:48 -05:00
echo "NOTE: The PVC client API daemon (pvcapid.service) and the PVC Worker daemon (pvcworkerd.service) have not been started; create a config file at /etc/pvc/pvcapid.yaml, then run the database configuration (/usr/share/pvc/pvc-api-db-upgrade) and start them manually."
2019-12-14 14:12:55 -05:00
fi
2023-10-26 12:56:20 -04:00
# Clean up any old sample configs
rm /etc/pvc/pvcapid.sample.yaml || true