>
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

As you are daemonizing uWSGI, you should set
Type to forking and specify the PidFile.

If you prefer the 'notify' system, change daemonize to logto
in uWSGI config.

Let me know if it works



To be honest, I tried the forking method yesterday too but it didn't work either (probably because i have not set PidFile). Nevertheless i'd prefer the notify method if possible. I changed the "daemonize" config option to "logto" now and the behaviour seems to have changed, while still not working correctly. Instead of saying "deactivating", a `systemctl status app1.uwsgi.service' will now display "activating" as its status, but it will takes long time to start and drops with an error message:

  [cjurk ~]# sudo systemctl start app1.uwsgi.service


Job for app1.uwsgi.service failed. See 'systemctl status app1.uwsgi.service' and 'journalctl' for details.

  [cjurk ~]# sudo systemctl status app1.uwsgi.service
  app1.uwsgi.service - App1 via uWSGI
Loaded: loaded (/usr/lib/systemd/system/app1.uwsgi.service; enabled) Active: activating (start) since Tue, 09 Oct 2012 07:47:33 +0000; 10s ago Process: 14920 ExecStartPre=/bin/chown app1:app1 /run/app1 (code=exited, status=0/SUCCESS) Process: 14917 ExecStartPre=/bin/mkdir -p /run/app1 (code=exited, status=0/SUCCESS)
          Main PID: 14923 (uwsgi)
            CGroup: name=systemd:/system/app1.uwsgi.service
                    ├ 14923 /usr/bin/uwsgi --ini /etc/uwsgi/app1.ini
                    ├ 14924 /usr/bin/uwsgi --ini /etc/uwsgi/app1.ini
                    ├ 14925 /usr/bin/uwsgi --ini /etc/uwsgi/app1.ini
                    ├ 14926 /usr/bin/uwsgi --ini /etc/uwsgi/app1.ini
                    ├ 14927 /usr/bin/uwsgi --ini /etc/uwsgi/app1.ini
                    └ 14928 /usr/bin/uwsgi --ini /etc/uwsgi/app1.ini

  Oct 09 07:47:33 DE-HAM1-NMC-01 systemd[1]: Stopping app1 via uWSGI...
  Oct 09 07:47:33 DE-HAM1-NMC-01 systemd[1]: Starting app1 via uWSGI...
Oct 09 07:47:34 DE-HAM1-NMC-01 uwsgi[14923]: [uWSGI] getting INI configuration from /etc/uwsgi/app1.ini

I'm not sure why it still waits for something (the processes are spawned). Any hints on this?


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

Reply via email to