Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
bekbulatov opened this issue Mar 27, 2013 · 5 comments
Closed

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

bekbulatov opened this issue Mar 27, 2013 · 5 comments

Comments

@bekbulatov
Copy link

After running uwsgi in daemon mode,

uwsgi --http-socket=127.0.0.1:8000 --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
Copy link
Owner

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)

@bekbulatov
Copy link
Author

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
Copy link
Owner

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
Copy link
Contributor

Can we close this issue?

@bekbulatov
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants