how to restart only one app in uwsgi?

1,719 views
Skip to first unread message

Bruno Rocha

unread,
Jan 27, 2012, 11:10:29 AM1/27/12
to web...@googlegroups.com
HI,

May be it is a better question to uwsgi list, but maybe someone here knows..

I have several apps in a single server running uwsgi, every time I need to reload some modules in some app I do

/etc/init.d/uwsgi-python restart

But it restarts all my apps..

Is there a way to specify which app to restart?

Thanks

--

Niphlod

unread,
Feb 5, 2012, 11:21:28 AM2/5/12
to web2py-users
I think the default /etc/init.d script for uwsgi-python allows
specifying the "app" name (actually it's the name of the config file)
only for "status", i.e. /etc/init.d/uwsgi-python status appname

However, pids are in /var/run/uwsgi-python/appname/pid.

If I'm not wrong, sighup to the master process reloads, so

kill -1 `cat /var/run/uwsgi-python/appname/pid`

should do the job.

Consider also using the "touch-reload" option of uwsgi

Bruno Rocha

unread,
Feb 6, 2012, 6:15:38 PM2/6/12
to web...@googlegroups.com


On Sun, Feb 5, 2012 at 2:21 PM, Niphlod <nip...@gmail.com> wrote:
kill -1 `cat /var/run/uwsgi-python/appname/pid`

Thanks! that works!

Niphlod

unread,
Feb 7, 2012, 9:17:18 AM2/7/12
to web...@googlegroups.com
oh yeah, I tested it :D

Now I'm planning a "move" towards running uwsgi in emperor mode and keeping the emperor process alive and kicking with upstart....

http://projects.unbit.it/uwsgi/wiki/Emperor

Summary : Just point the emperor to a folder with config files, it thinks at all the rest. Remove a config--> app stops, add a config--> app starts, touch the config --> it reloads only that app.

Seems a lot funnier to work with. I had a lot of headaches trying to understand /etc/init.d/uwsgi-python (I like to mess with things a lot before using them plainly :D )


Reply all
Reply to author
Forward
0 new messages