systemd default file
authorDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 8 Dec 2016 21:50:03 +0000 (22:50 +0100)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 8 Dec 2016 21:50:39 +0000 (22:50 +0100)
bin/install-systemd.sh
default/gnt-monitor [new file with mode: 0644]
defaults/gnt-monitor [deleted file]
systemd/gnt-monitor.service

index d79b9ae..4eecab8 100755 (executable)
@@ -1,10 +1,15 @@
 #!/bin/sh -xe
 sudo cp gnt-monitor /etc/ganeti/
 sudo gnt-cluster copyfile /etc/ganeti/gnt-monitor
+
 sudo cp systemd/gnt-monitor.service /etc/systemd/system/
 sudo gnt-cluster copyfile /etc/systemd/system/gnt-monitor.service
+
+test -e /etc/default/gnt-monitor || cp -v default/gnt-monitor /etc/default/ && echo "# modify config here"
+sudo gnt-cluster copyfile /etc/default/gnt-monitor
+
 sudo gnt-cluster command systemctl daemon-reload
 sudo gnt-cluster command systemctl enable gnt-monitor
-sudo gnt-cluster command killall gnt-monitor
+#sudo gnt-cluster command killall gnt-monitor
 sudo gnt-cluster command systemctl start gnt-monitor
 sudo gnt-cluster command systemctl status gnt-monitor
diff --git a/default/gnt-monitor b/default/gnt-monitor
new file mode 100644 (file)
index 0000000..f04f59c
--- /dev/null
@@ -0,0 +1,4 @@
+DC=ffzg
+RACK=3
+INFLUX=http://10.80.3.89:8086/write?db=ganeti
+INTERVAL=1
diff --git a/defaults/gnt-monitor b/defaults/gnt-monitor
deleted file mode 100644 (file)
index f04f59c..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-DC=ffzg
-RACK=3
-INFLUX=http://10.80.3.89:8086/write?db=ganeti
-INTERVAL=1
index fe5a3ce..1a882e6 100644 (file)
@@ -2,6 +2,7 @@
 Description=Ganeti monitor to InfluxDB
 
 [Service]
+EnvironmentFile=-/etc/default/gnt-monitor
 #Type=simple
 ExecStart=/etc/ganeti/gnt-monitor
 Restart=always