Hi, and thanks for your answer. Please forgive if this question is stupid but this is almost my first time using UWSGI and i am not sure if i explained myself correctly.
What i am trying to daemonize is the main UWSGI process rather then the vassals ... i am not specifing any option for daemonize on the vassals themself but just for the UWSGI daemon when started with an init script. If i can't use --daemonize2 in any way without having to sigterm the daemon, Is it safe / correct to start the UWSGI daemon with "--daemonize" and let it manage the vassals or that is completely wrong? Thanks Francesco On Mon, Oct 21, 2013 at 10:53 AM, Roberto De Ioris <[email protected]> wrote: > > > Hi, > > > > I am trying to run UWSGI in emperor mode (for the first time in my life) > > and i am having some issues in getting the vassals to spawn when uwsgi is > > running with "--daemonize2". It works just fine with "--daemonize" but i > > would really rather use "--daemonize2" for reasons outside of the scope > of > > this help request :) > > > > UWSGI version is 1.4.8 > > > > My issue is that when UWSGI is started with --daemonize2 the uwsgi daemon > > does not spawn any vassal until i SIGTERM it, when I do then it seems to > > behave as expected, it finds the vassal and spawn the processes. > > > > for example: > > [root@mybox]# service uwsgi start > > > > [root@mybox]# ps auxww | grep uwsgi > > > > nobody 13075 0.0 0.0 19364 780 ? S 10:36 0:00 > > /usr/sbin/uwsgi --logto /var/log/uwsgi/error.log --daemonize2 > > /var/log/uwsgi/error.log --logfile-chmod 644 --logfile-chown --pidfile2 > > /var/run/uwsgi/uwsgi.pid --stats /var/run/uwsgi/uwsgi.stats --zerg-server > > /var/run/uwsgi/uwsgi.zerg --need-app --ini /etc/uwsgi/uwsgi.ini > > [root@mybox]# > > > > Then i SIGTERM it > > > > [root@mybox]# kill 13075 > > [root@mybox]# ps auxww | grep uwsgi > > nobody 13075 0.0 0.0 18940 1480 ? S 10:36 0:00 > > /usr/sbin/uwsgi --logto /var/log/uwsgi/error.log --daemonize2 > > /var/log/uwsgi/error.log --logfile-chmod 644 --logfile-chown --pidfile2 > > /var/run/uwsgi/uwsgi.pid --stats /var/run/uwsgi/uwsgi.stats --zerg-server > > /var/run/uwsgi/uwsgi.zerg --need-app --ini /etc/uwsgi/uwsgi.ini > > nobody 13089 0.0 0.0 18768 684 ? S 10:36 0:00 > > /usr/sbin/uwsgi --logto /var/log/uwsgi/error.log --daemonize2 > > /var/log/uwsgi/error.log --logfile-chmod 644 --logfile-chown --pidfile2 > > /var/run/uwsgi/uwsgi.pid --stats /var/run/uwsgi/uwsgi.stats --zerg-server > > /var/run/uwsgi/uwsgi.zerg --need-app --ini /etc/uwsgi/uwsgi.ini > > nobody 13090 3.0 0.1 94456 5004 ? S 10:36 0:00 > > /usr/sbin/uwsgi --ini /etc/uwsgi/vassals/test.ini --inherit true > > nobody 13091 0.0 0.0 94456 2012 ? S 10:36 0:00 > > /usr/sbin/uwsgi --ini /etc/uwsgi/vassals/test.ini --inherit true > > nobody 13092 0.0 0.0 94456 2012 ? S 10:36 0:00 > > /usr/sbin/uwsgi --ini /etc/uwsgi/vassals/test.ini --inherit true > > nobody 13093 0.0 0.0 94456 2012 ? S 10:36 0:00 > > /usr/sbin/uwsgi --ini /etc/uwsgi/vassals/test.ini --inherit true > > nobody 13094 0.0 0.0 94456 2012 ? S 10:36 0:00 > > /usr/sbin/uwsgi --ini /etc/uwsgi/vassals/test.ini --inherit true > > nobody 13095 0.0 0.0 94456 2012 ? S 10:36 0:00 > > /usr/sbin/uwsgi --ini /etc/uwsgi/vassals/test.ini --inherit true > > nobody 13096 0.0 0.0 94456 2012 ? S 10:36 0:00 > > /usr/sbin/uwsgi --ini /etc/uwsgi/vassals/test.ini --inherit true > > nobody 13097 0.0 0.0 94456 2012 ? S 10:36 0:00 > > /usr/sbin/uwsgi --ini /etc/uwsgi/vassals/test.ini --inherit true > > nobody 13098 0.0 0.0 94456 2012 ? S 10:36 0:00 > > /usr/sbin/uwsgi --ini /etc/uwsgi/vassals/test.ini --inherit true > > nobody 13099 0.0 0.0 94456 2012 ? S 10:36 0:00 > > /usr/sbin/uwsgi --ini /etc/uwsgi/vassals/test.ini --inherit true > > nobody 13100 0.0 0.0 94456 2012 ? S 10:36 0:00 > > /usr/sbin/uwsgi --ini /etc/uwsgi/vassals/test.ini --inherit true > > > > logs shows : > > > > Mon Oct 21 11:06:05 2013 - *** starting uWSGI Emperor *** > > Mon Oct 21 11:06:05 2013 - detected max file descriptor number: 8192 > > Mon Oct 21 11:06:05 2013 - lock engine: pthread robust mutexes > > Mon Oct 21 11:06:05 2013 - mapped 84712 bytes (82 KB) for 0 cores > > Mon Oct 21 11:06:05 2013 - *** Operational MODE: no-workers *** > > Mon Oct 21 11:06:05 2013 - gracefully (RE)spawned uWSGI master process > > (pid: 13075) > > Mon Oct 21 11:06:05 2013 - *** Zerg server enabled on > > /var/run/uwsgi/uwsgi.zerg *** > > Mon Oct 21 11:06:05 2013 - *** Stats server enabled on > > /var/run/uwsgi/uwsgi.stats fd: 7 *** > > > > and when I SIGTERM it > > > > *** has_emperor mode detected (fd: 5) *** > > [uWSGI] getting INI configuration from /etc/uwsgi/vassals/test.ini > > Mon Oct 21 11:08:23 2013 - [emperor] vassal /etc/uwsgi/vassals/test.ini > is > > now loyal > > Mon Oct 21 11:08:23 2013 - [emperor] vassal /etc/uwsgi/vassals/test.ini > is > > now loyal > > > > When i start it with just "--daemonize" this all happen at startup and > > everything works. > > > > Is there anything i can do (or i am doing wrong) to get it to work with > > "--daemonize2" ? > > > > Thanks > > Francesco > > > > > > > Hi, process managed by the Emperor cannot daemonize, when you specify > --daemonize under a vassal it is automatically disabled (this does not > happens for daemonize2): > > > http://uwsgi-docs.readthedocs.org/en/latest/Emperor.html#running-non-uwsgi-apps-or-using-alternative-uwsgis-as-vassals > > > -- > Roberto De Ioris > http://unbit.it > _______________________________________________ > uWSGI mailing list > [email protected] > http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi >
_______________________________________________ uWSGI mailing list [email protected] http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
