From: Dobrica Pavlinusic Date: Thu, 8 Dec 2016 21:50:03 +0000 (+0100) Subject: systemd default file X-Git-Url: http://git.rot13.org/?p=gnt-info;a=commitdiff_plain;h=758fbb88c90ebc3dd49d93d19a6506c757745ea5;hp=feadc312d73bb452a68da59b64152be9086cfbea systemd default file --- diff --git a/bin/install-systemd.sh b/bin/install-systemd.sh index d79b9ae..4eecab8 100755 --- a/bin/install-systemd.sh +++ b/bin/install-systemd.sh @@ -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 index 0000000..f04f59c --- /dev/null +++ b/default/gnt-monitor @@ -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 index f04f59c..0000000 --- a/defaults/gnt-monitor +++ /dev/null @@ -1,4 +0,0 @@ -DC=ffzg -RACK=3 -INFLUX=http://10.80.3.89:8086/write?db=ganeti -INTERVAL=1 diff --git a/systemd/gnt-monitor.service b/systemd/gnt-monitor.service index fe5a3ce..1a882e6 100644 --- a/systemd/gnt-monitor.service +++ b/systemd/gnt-monitor.service @@ -2,6 +2,7 @@ Description=Ganeti monitor to InfluxDB [Service] +EnvironmentFile=-/etc/default/gnt-monitor #Type=simple ExecStart=/etc/ganeti/gnt-monitor Restart=always