Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Uwsgi return zero status code even if it hasn't been run #195

bekbulatov opened this Issue Mar 27, 2013 · 5 comments


None yet
3 participants

After running uwsgi in daemon mode,

uwsgi --http-socket= --daemonize=/logs/uwsgi_log

returns 0 even if server hasn't been run (port is busy, no permission to open logs, etc) but pid file is created successfully.

I'd like to check exit code and delete pid file in this case.


unbit commented Mar 27, 2013

You may want to try --daemonize2 that daemonize only after app loading (and combined with --need-app will return an exit code on app loading error instead of going in dynamic mode)

Thank you, it works. But should I delete pid file manually in my rc script or is there any option for that?
Upd. But with --daemonize2 I got another issue:
When I run with --uid, --gid options I got en error

open("/var/run/uwsgi.pid"): Permission denied [core/utils.c line 4225]

But master process creates this file with root owner I can't write it later.


unbit commented Mar 27, 2013

use --pidfile2 it postpone the pidfile creation. The --vacuum option will clear pidfile and unix sockets, you can try with it.


prymitive commented Apr 13, 2013

Can we close this issue?

Thank you. I've managed to run server with --pidfile2, --daemonize2, --need-app options and get what I want. But I'm still having "Permission denied" issue when running from different user (--uid, --gid). Can't open pid file.

@unbit unbit closed this Jul 12, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment