__netbox*: update systemd service files
The `uwsgi-netbox` service now works, also the `netbox` wrapper service. The PID file was removed from the Gunicorn service as it is not required and a bit more efford to move it to `/run/` due to permissions. Generally, all depend on `network.target` instead of `network-online.target` now, and signals for reload, stop and kill were added (especially required the uwsgi service).
This commit is contained in:
parent
314a0d4d8e
commit
755bd9098e
3 changed files with 20 additions and 15 deletions
|
@ -1,12 +1,13 @@
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=NetBox Service Wrapper
|
Description=NetBox Service Wrapper
|
||||||
Documentation=https://netbox.readthedocs.io/en/stable/
|
Documentation=https://netbox.readthedocs.io/en/stable/
|
||||||
After=network-online.target
|
After=network.target
|
||||||
Wants=network-online.target
|
Wants=network.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
RemainAfterExit=yes
|
RemainAfterExit=yes
|
||||||
|
ExecStart=/bin/true
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
|
@ -3,22 +3,24 @@ Description=NetBox Gunicorn WSGI Service
|
||||||
Documentation=https://netbox.readthedocs.io/en/stable/
|
Documentation=https://netbox.readthedocs.io/en/stable/
|
||||||
PartOf=netbox.service
|
PartOf=netbox.service
|
||||||
After=netbox.service
|
After=netbox.service
|
||||||
After=network-online.target
|
After=network.target
|
||||||
Wants=network-online.target
|
Wants=network.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
|
|
||||||
User=netbox
|
User=netbox
|
||||||
Group=netbox
|
Group=netbox
|
||||||
PIDFile=/var/tmp/netbox.pid
|
|
||||||
WorkingDirectory=/opt/netbox
|
WorkingDirectory=/opt/netbox
|
||||||
|
|
||||||
ExecStart=/opt/netbox/venv/bin/gunicorn --pid /var/tmp/netbox.pid --pythonpath /opt/netbox/netbox --config /opt/netbox/gunicorn.py netbox.wsgi
|
ExecStart=/opt/netbox/venv/bin/gunicorn --pythonpath /opt/netbox/netbox --config /opt/netbox/gunicorn.py netbox.wsgi
|
||||||
|
# signals: https://docs.gunicorn.org/en/stable/signals.html
|
||||||
|
ExecReload=kill -HUP $MAINPID
|
||||||
|
ExecStop=kill -TERM $MAINPID
|
||||||
|
KillSignal=SIGQUIT
|
||||||
|
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
RestartSec=30
|
RestartSec=30
|
||||||
PrivateTmp=true
|
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=netbox.service
|
||||||
|
|
|
@ -3,22 +3,24 @@ Description=Netbox uWSGI WSGI Service
|
||||||
Documentation=https://netbox.readthedocs.io/en/stable/
|
Documentation=https://netbox.readthedocs.io/en/stable/
|
||||||
PartOf=netbox.service
|
PartOf=netbox.service
|
||||||
After=netbox.service
|
After=netbox.service
|
||||||
After=network-online.target
|
After=network.target
|
||||||
Wants=network-online.target
|
Wants=network.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
|
|
||||||
User=netbox
|
User=netbox
|
||||||
Group=netbox
|
Group=netbox
|
||||||
PIDFile=/var/tmp/netbox.pid
|
WorkingDirectory=/opt/netbox/netbox/
|
||||||
WorkingDirectory=/opt/netbox
|
|
||||||
|
|
||||||
ExecStart=/opt/netbox/venv/bin/uwsgi --master --wsgi-file netbox/netbox/wsgi.py uwsgi.ini
|
ExecStart=/opt/netbox/venv/bin/uwsgi --master --module netbox.wsgi uwsgi.ini
|
||||||
|
# signals: https://uwsgi-docs.readthedocs.io/en/latest/Management.html#signals-for-controlling-uwsgi
|
||||||
|
ExecReload=kill -HUP $MAINPID
|
||||||
|
ExecStop=kill -INT $MAINPID
|
||||||
|
KillSignal=SIGQUIT
|
||||||
|
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
RestartSec=30
|
RestartSec=30
|
||||||
PrivateTmp=true
|
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=netbox.service
|
||||||
|
|
Loading…
Reference in a new issue