Skip to content

Instantly share code, notes, and snippets.

@abkunal
Created October 21, 2020 07:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abkunal/25b7b3358db43ba15e7342484bf17da2 to your computer and use it in GitHub Desktop.
Save abkunal/25b7b3358db43ba15e7342484bf17da2 to your computer and use it in GitHub Desktop.
UWSGI service file for systemd
## https://levelup.gitconnected.com/integrating-new-relic-apm-with-uwsgi-1dedcd0f92ff
[Unit]
Description=uWSGI Emperor service
[Service]
Environment="NEW_RELIC_CONFIG_FILE=/home/ubuntu/myapp/myapp/newrelic.ini"
Environment="NEW_RELIC_ENVIRONMENT=production"
ExecStartPre=/bin/bash -c 'mkdir -p /run/uwsgi; chown ubuntu:www-data /run/uwsgi'
ExecStart=/home/ubuntu/virtualenvs/myenv/bin/newrelic-admin run-program /home/ubuntu/virtualenvs/myenv/bin/uwsgi --emperor /etc/uwsgi/sitesRestart=always
KillSignal=SIGQUIT
Type=notify
NotifyAccess=all
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment