Hi there,
i've been trying to get uWSGI running along with nginx on Arch Linux. I do not need Emperor, as I have only one Django application to be deployed. I've created the systemd service file as below:

  [cjurk ~]# cat /usr/lib/systemd/system/app1.uwsgi.service
  [Unit]
  Description=App1 via uWSGI
  After=syslog.target

  [Service]
  ExecStart=/usr/bin/uwsgi --ini /etc/uwsgi/app1.ini
  ExecStartPre=/bin/mkdir -p /run/app1
  ExecStartPre=/bin/chown app1:app1 /run/app1
  #KillSignal=SIGINT
  ExecReload=/bin/kill -HUP $MAINPID
  Restart=always
  Type=notify
  StandardError=syslog
  NotifyAccess=main

  [Install]
  WantedBy=multi-user.target

Please note the line starting "KillSignal" - i have commented it out, because that way the service is started-stopped-started and then failed. No idea why.

However, with the above configuration, the service keeps a long time to start (uwsgi is actually started, as there are some processed created), but systemd reports the service status as being "deactivating":

  [cjurk ~]# sudo systemctl status app1.uwsgi.service
  app1.uwsgi.service - App1 via uWSGI
Loaded: loaded (/usr/lib/systemd/system/nmc.uwsgi.service; enabled) Active: deactivating (stop-sigterm) since Mon, 08 Oct 2012 23:38:08 +0000; 16min ago Process: 1475 ExecStart=/usr/bin/uwsgi --ini /etc/uwsgi/app1.ini (code=exited, status=0/SUCCESS) Process: 1472 ExecStartPre=/bin/chown app1:app1 /run/app1 (code=exited, status=0/SUCCESS) Process: 1469 ExecStartPre=/bin/mkdir -p /run/app1 (code=exited, status=0/SUCCESS)
            CGroup: name=systemd:/system/app1.uwsgi.service
                    ├ 1477 /usr/bin/uwsgi --ini /etc/uwsgi/app1.ini
                    ├ 1478 /usr/bin/uwsgi --ini /etc/uwsgi/app1.ini
                    ├ 1479 /usr/bin/uwsgi --ini /etc/uwsgi/app1.ini
                    ├ 1480 /usr/bin/uwsgi --ini /etc/uwsgi/app1.ini
                    ├ 1481 /usr/bin/uwsgi --ini /etc/uwsgi/app1.ini
                    └ 1482 /usr/bin/uwsgi --ini /etc/uwsgi/app1.ini

  Oct 08 23:54:37 DE-HAM1-NMC-01 systemd[1]: Starting App1 via uWSGI...
Oct 08 23:54:38 DE-HAM1-NMC-01 uwsgi[1475]: [uWSGI] getting INI configuration from /etc/uwsgi/app1.ini

That situation is not satisfying for me right now, because I'd like to have the service running properly under systemd. NOTIFY_SOCKET is correctly set and I don't get any errors that may indicate a communication problems between uwsgi and systemd. Maybe something is wrong with my configuration. I appreciate any hints towards a running systemd service.

Last, but not least - the uwsgi configuration at /etc/uwsgi/app1.ini:

  [uwsgi]
  chdir=/opt/app1
  module=app1.wsgi:application
  master=True
  pidfile=/run/app1/master.pid
  vacuum=True
  max-requests=5000
  daemonize=/var/log/app1_uwsgi.log
  uid=app1
  gid=app1
  processes=5
  socket=/run/app1/app1.sock
  env=DJANGO_SETTINGS_MODULE=app1.settings


Thank you.

_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to