Skip to content

Instantly share code, notes, and snippets.

@joxz
Last active May 4, 2018 15:58
Show Gist options
  • Save joxz/17f8c95983c1b3df937df543c3e56078 to your computer and use it in GitHub Desktop.
Save joxz/17f8c95983c1b3df937df543c3e56078 to your computer and use it in GitHub Desktop.
Netbox using uWSGI and systemd
[Unit]
Description=NetBox IPAM/DCIM Tool
Documentation=http://netbox.readthedocs.io/en/stable/
Requires=netbox.socket
After=syslog.target
[Service]
ExecStart=/usr/local/bin/uwsgi --ini /opt/netbox/uwsgi.ini
ExecReload=/bin/kill -1 $MAINPID
ExecStop=/bin/kill -2 $MAINPID
StandardInput=socket
StandardOutput=journal
StandardError=journal
User=www-data
Group=www-data
Restart=on-failure
WorkingDirectory=/opt/netbox/netbox
KillSignal=SIGQUIT
Type=notify
StandardError=syslog
NotifyAccess=all
DeviceAllow=/dev/null rw
DeviceAllow=/dev/urandom r
DeviceAllow=/dev/zero r
[Install]
WantedBy=multi-user.target
[Unit]
Description=Socket for NetBox IPAM/DCIM Tool
[Socket]
ListenStream=127.0.0.1:8001
SocketUser=www-data
SocketGroup=www-data
[Install]
WantedBy=sockets.target
[uwsgi]
master=true
protocol=http
uid=www-data
gid=www-data
processes=2
module=netbox.wsgi
chdir=/opt/netbox/netbox/
static-map=/=/opt/netbox/netbox/static
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment