aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgenofire <geno+dev@fireorbit.de>2020-06-10 07:28:10 +0200
committergenofire <geno+dev@fireorbit.de>2020-06-10 07:35:45 +0200
commitf14c9af6ee0c0399c2ec83e58402f01e9b47a06d (patch)
tree875b7d5f52e773072d217173e2980a78e5dae17c
parent3b451600cf5c5adda6e691610216e8eb43440abd (diff)
systemd: add support for venv and cleanup
-rw-r--r--contrib/init/linux-systemd/ejabberd-cleanup.service14
-rw-r--r--contrib/init/linux-systemd/ejabberd-cleanup.timer9
-rw-r--r--contrib/init/linux-systemd/ejabberd-influxdb.service6
3 files changed, 27 insertions, 2 deletions
diff --git a/contrib/init/linux-systemd/ejabberd-cleanup.service b/contrib/init/linux-systemd/ejabberd-cleanup.service
new file mode 100644
index 0000000..e68de47
--- /dev/null
+++ b/contrib/init/linux-systemd/ejabberd-cleanup.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=Clean up ejabberd
+
+[Service]
+Type=oneshot
+User=nobody
+Group=nobody
+Environment="VIRTUAL_ENV=/opt/ejabberd-tools/venv"
+Environment="PATH=/opt/ejabberd-tools/venv/bin:/usr/local/bin:/usr/bin:/bin"
+ExecStart=/opt/ejabberd-tools/cleanup.py
+WorkingDirectory=/opt/ejabberd-tools/
+
+[Install]
+WantedBy=multi-user.target
diff --git a/contrib/init/linux-systemd/ejabberd-cleanup.timer b/contrib/init/linux-systemd/ejabberd-cleanup.timer
new file mode 100644
index 0000000..1b95433
--- /dev/null
+++ b/contrib/init/linux-systemd/ejabberd-cleanup.timer
@@ -0,0 +1,9 @@
+[Unit]
+Description=Clean up ejabberd every 6h and on boot
+
+[Timer]
+OnBootSec=15min
+OnUnitActiveSec=6h
+
+[Install]
+WantedBy=timers.target
diff --git a/contrib/init/linux-systemd/ejabberd-influxdb.service b/contrib/init/linux-systemd/ejabberd-influxdb.service
index 2c4c1b3..af25ae9 100644
--- a/contrib/init/linux-systemd/ejabberd-influxdb.service
+++ b/contrib/init/linux-systemd/ejabberd-influxdb.service
@@ -5,10 +5,12 @@ Description=ejabberd influxdb exporter
Type=simple
User=nobody
Group=nogroup
-ExecStart=/opt/ejabberd-metrics/influx.py
+Environment="VIRTUAL_ENV=/opt/ejabberd-tools/venv"
+Environment="PATH=/opt/ejabberd-tools/venv/bin:/usr/local/bin:/usr/bin:/bin"
+ExecStart=/opt/ejabberd-tools/influx.py
+WorkingDirectory=/opt/ejabberd-tools/
Restart=always
RestartSec=5s
-Environment=PATH=/usr/bin:/usr/local/bin
[Install]
WantedBy=multi-user.target