add systemd timer unit to trigger pvesr run
This commit is contained in:
parent
efa075d9be
commit
c74a828da0
@ -18,7 +18,9 @@ SERVICES= \
|
||||
pvedaemon.service \
|
||||
pveproxy.service \
|
||||
spiceproxy.service \
|
||||
pve-storage.target
|
||||
pve-storage.target \
|
||||
pvesr.service \
|
||||
pvesr.timer
|
||||
|
||||
.PHONY: install
|
||||
install: ${SCRIPTS}
|
||||
|
5
bin/init.d/pvesr.service
Normal file
5
bin/init.d/pvesr.service
Normal file
@ -0,0 +1,5 @@
|
||||
[Unit]
|
||||
Description=Proxmox VE replication runner
|
||||
|
||||
[Service]
|
||||
ExecStart=@/usr/bin/pvesr "/usr/bin/pvesr" "run"
|
11
bin/init.d/pvesr.timer
Normal file
11
bin/init.d/pvesr.timer
Normal file
@ -0,0 +1,11 @@
|
||||
[Unit]
|
||||
Description=Proxmox VE replication runner
|
||||
|
||||
[Timer]
|
||||
RemainAfterElapse=no
|
||||
|
||||
[Timer]
|
||||
OnCalendar=minutely
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
17
debian/postinst
vendored
17
debian/postinst
vendored
@ -95,6 +95,21 @@ EOF
|
||||
|
||||
# same as dh_systemd_enable (code copied)
|
||||
|
||||
for timer in pvesr; do
|
||||
deb-systemd-helper unmask $timer.timer >/dev/null || true
|
||||
|
||||
# was-enabled defaults to true, so new installations run enable.
|
||||
if deb-systemd-helper --quiet was-enabled $timer.timer; then
|
||||
# Enables the unit on first installation, creates new
|
||||
# symlinks on upgrades if the unit file has changed.
|
||||
deb-systemd-helper enable $timer.timer >/dev/null || true
|
||||
else
|
||||
# Update the statefile to add new symlinks (if any), which need to be
|
||||
# cleaned up on purge. Also remove old symlinks.
|
||||
deb-systemd-helper update-state $timer.timer >/dev/null || true
|
||||
fi
|
||||
done
|
||||
|
||||
for service in pvedaemon pveproxy spiceproxy pvestatd pvebanner pvenetcommit pve-manager; do
|
||||
deb-systemd-helper unmask $service.service >/dev/null || true
|
||||
|
||||
@ -115,6 +130,8 @@ EOF
|
||||
for service in pvedaemon pveproxy spiceproxy pvestatd; do
|
||||
deb-systemd-invoke reload-or-restart $service
|
||||
done
|
||||
|
||||
deb-systemd-invoke start pvesr.timer >/dev/null || true
|
||||
fi
|
||||
|
||||
# rewrite banner
|
||||
|
13
debian/postrm
vendored
13
debian/postrm
vendored
@ -23,7 +23,14 @@ esac
|
||||
systemctl --system daemon-reload >/dev/null || true
|
||||
|
||||
PVESERVICES="pvedaemon pveproxy spiceproxy pvestatd pvebanner pvenetcommit pve-manager"
|
||||
PVETIMERS="pvesr"
|
||||
|
||||
if [ "$1" = "remove" ]; then
|
||||
for timer in ${PVETIMERS}; do
|
||||
if [ -x "/usr/bin/deb-systemd-helper" ]; then
|
||||
deb-systemd-helper mask $timer.timer >/dev/null
|
||||
fi
|
||||
done
|
||||
for service in ${PVESERVICES}; do
|
||||
if [ -x "/usr/bin/deb-systemd-helper" ]; then
|
||||
deb-systemd-helper mask $service.service >/dev/null
|
||||
@ -32,6 +39,12 @@ if [ "$1" = "remove" ]; then
|
||||
fi
|
||||
|
||||
if [ "$1" = purge ]; then
|
||||
for timer in ${PVETIMERS}; do
|
||||
if [ -x "/usr/bin/deb-systemd-helper" ]; then
|
||||
deb-systemd-helper purge $timer.timer >/dev/null
|
||||
deb-systemd-helper unmask $timer.timer >/dev/null
|
||||
fi
|
||||
done
|
||||
for service in ${PVESERVICES}; do
|
||||
if [ -x "/usr/bin/deb-systemd-helper" ]; then
|
||||
deb-systemd-helper purge $service.service >/dev/null
|
||||
|
Loading…
Reference in New Issue
Block a user