Konfiguriere Minion Job Queue

This commit is contained in:
phil 2022-12-14 17:17:59 +01:00
parent 400b61b934
commit 2c02f0d5cb
5 changed files with 59 additions and 6 deletions

View file

@ -0,0 +1,21 @@
[Unit]
Description=Shortened URLs service job queue
Documentation=https://framagit.org/fiat-tux/hat-softwares/lstu
[Service]
Type=simple
User={{ lstu_user }}
WorkingDirectory={{ lstu.path }}
ExecStart=/usr/bin/carton exec script/application minion worker
# Hardening
CapabilityBoundingSet=
PrivateMounts=true
PrivateTmp=true
ProtectControlGroups=true
ProtectHome=true
ProtectSystem=strict
ReadWritePaths=-{{ lstu.path }}
[Install]
WantedBy=multi-user.target

View file

@ -2,3 +2,7 @@ check process lstu with pidfile {{ lstu.path }}/script/hypnotoad.pid
start program = "/bin/systemctl start {{ lstu_service }}"
stop program = "/bin/systemctl stop {{ lstu_service }}"
if failed host {{ ansible_default_ipv4.address }} port 8080 with timeout 15 seconds for 3 times within 4 cycles then restart
check process lstu-minion matching "perl script/application minion worker"
start program = "/bin/systemctl start {{ minion_service }}"
stop program = "/bin/systemctl stop {{ minion_service }}"