systemd: add support for venv and cleanup
This commit is contained in:
parent
3b451600cf
commit
f14c9af6ee
|
@ -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
|
|
@ -0,0 +1,9 @@
|
||||||
|
[Unit]
|
||||||
|
Description=Clean up ejabberd every 6h and on boot
|
||||||
|
|
||||||
|
[Timer]
|
||||||
|
OnBootSec=15min
|
||||||
|
OnUnitActiveSec=6h
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=timers.target
|
|
@ -5,10 +5,12 @@ Description=ejabberd influxdb exporter
|
||||||
Type=simple
|
Type=simple
|
||||||
User=nobody
|
User=nobody
|
||||||
Group=nogroup
|
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
|
Restart=always
|
||||||
RestartSec=5s
|
RestartSec=5s
|
||||||
Environment=PATH=/usr/bin:/usr/local/bin
|
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
Loading…
Reference in New Issue