mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-09 00:58:16 -06:00
Merge bee16ef752
into 9440ac7640
This commit is contained in:
commit
16aad838f5
17
scripts/netbox-rqworker.service
Normal file
17
scripts/netbox-rqworker.service
Normal file
@ -0,0 +1,17 @@
|
||||
# Alternative to using supervisord for running the NetBox Redis Worker
|
||||
# 1. Create in /etc/systemd/system/netbox-rqworker.service
|
||||
# 2. systemctl enable netbox-rqworker && systemctl restart netbox-rqworker
|
||||
|
||||
[Unit]
|
||||
Description=NetBox rqworker
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=netbox
|
||||
Group=netbox
|
||||
Environment=LC_ALL=C.UTF-8 LANG=C.UTF-8
|
||||
ExecStart=/usr/bin/python3 /opt/netbox/netbox/manage.py rqworker
|
||||
WorkingDirectory=/opt/netbox/netbox
|
||||
|
||||
[Install]
|
||||
WantedBy=redis-server.service
|
17
scripts/netbox-unit.json
Normal file
17
scripts/netbox-unit.json
Normal file
@ -0,0 +1,17 @@
|
||||
{
|
||||
"listeners": {
|
||||
"*:8001": {
|
||||
"application": "netbox"
|
||||
}
|
||||
},
|
||||
"applications": {
|
||||
"netbox": {
|
||||
"type": "python 3.6",
|
||||
"user": "netbox",
|
||||
"group": "netbox",
|
||||
"processes": 2,
|
||||
"path": "/opt/netbox/netbox/",
|
||||
"module": "netbox.wsgi"
|
||||
}
|
||||
}
|
||||
}
|
17
scripts/nunit-redis-install.sh
Normal file
17
scripts/nunit-redis-install.sh
Normal file
@ -0,0 +1,17 @@
|
||||
#!/bin/sh
|
||||
|
||||
# 1. Install Nginx Unit from https://unit.nginx.org/installation/ before running this.
|
||||
# 2. Check the other files to replace the "netbox" user, if using "www-data" or something else.
|
||||
# 3. chmod u+rx nunit-redis-install.sh && sudo ./nunit-redis-install.sh
|
||||
|
||||
# Remove supervisord & gunicorn, if only used for NetBox
|
||||
# apt remove supervisor gunicorn -y && apt autoremove -y
|
||||
|
||||
# Load Redis Worker service
|
||||
cp -f netbox-rqworker.service /etc/systemd/system/
|
||||
systemctl enable netbox-rqworker && systemctl restart netbox-rqworker
|
||||
|
||||
# Load NUnit config
|
||||
systemctl enable unit && systemctl restart unit
|
||||
sudo apt install curl -y
|
||||
sudo curl -X PUT -d @netbox-unit.json --unix-socket /var/control.unit.sock http://localhost/config/
|
Loading…
Reference in New Issue
Block a user