[pve-devel] [PATCH pve-manager 2/4] add systemd.timer for pve run

Wolfgang Link w.link at proxmox.com
Fri Jun 2 11:21:46 CEST 2017


---
 bin/init.d/Makefile      |  4 +++-
 bin/init.d/pvesr.service |  5 +++++
 bin/init.d/pvesr.timer   | 11 +++++++++++
 debian/postinst          |  4 ++++
 4 files changed, 23 insertions(+), 1 deletion(-)
 create mode 100644 bin/init.d/pvesr.service
 create mode 100644 bin/init.d/pvesr.timer

diff --git a/bin/init.d/Makefile b/bin/init.d/Makefile
index f984fe13..7daefd52 100644
--- a/bin/init.d/Makefile
+++ b/bin/init.d/Makefile
@@ -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}
diff --git a/bin/init.d/pvesr.service b/bin/init.d/pvesr.service
new file mode 100644
index 00000000..216ed2b4
--- /dev/null
+++ b/bin/init.d/pvesr.service
@@ -0,0 +1,5 @@
+[Unit]
+Description=Proxmox VE replica runner
+
+[Service]
+ExecStart=@/usr/bin/pvesr "/usr/bin/pvesr" "run"
diff --git a/bin/init.d/pvesr.timer b/bin/init.d/pvesr.timer
new file mode 100644
index 00000000..057a8b8b
--- /dev/null
+++ b/bin/init.d/pvesr.timer
@@ -0,0 +1,11 @@
+[Unit]
+Description=Proxmox VE replica runner
+
+[Timer]
+RemainAfterElapse=no
+
+[Timer]
+OnCalendar=minutely
+
+[Install]
+WantedBy=timers.target
\ No newline at end of file
diff --git a/debian/postinst b/debian/postinst
index 6aac8f85..4ecb96d1 100755
--- a/debian/postinst
+++ b/debian/postinst
@@ -110,6 +110,10 @@ EOF
 	fi
     done
 
+    # activate manualy because dh does not work on timers
+    systemctl --quiet is-enabled pvesr.timer || systemctl enable pvesr.timer
+    systemctl --quiet is-active pvesr.timer || systemctl start pvesr.timer
+
     if test ! -e /proxmox_install_mode; then
 
 	for service in pvedaemon pveproxy spiceproxy pvestatd; do
-- 
2.11.0





More information about the pve-devel mailing list