LoginSignup
3

More than 5 years have passed since last update.

uwsgiのemperorモードのservice化メモ

Posted at

どっからコピペしたのかも
なぜ動いてるのかもよくわからないけど
今使ってるuwsgiのemperorモードでのservice化のためのファイル(uwsgi.service)をメモしておく。

~/.venv/ 下にuwsgiのためだけのvenv設定済みという前提

$ cd ~
$ mkdir .venv
$ python3.6 -m venv .venv/uwsgi
$ source .venv/uwsgi/bin/activate
$ (uwsgi) pip install uwsgi

/etc/systemd/system/uwsgi.service
権限は644 root:root

[Unit]
Description=uWSGI Emperor service

[Service]
ExecStartPre=/usr/bin/bash -c 'mkdir -p /run/uwsgi; chown nginx:nginx /run/uwsgi'
ExecStart=/home/yourname/.venv/uwsgi/bin/uwsgi --emperor /etc/uwsgi/vassals
Restart=always
KillSignal=SIGQUIT
Type=notify
NotifyAccess=all

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3