Dear experts,
I've a strange behaviour with uWSGI and supervisor.

This is my settings in galaxy.ini file:
[uwsgi]
processes = 3
socket = 127.0.0.1:4001
stats = 127.0.0.1:9191
#socket = /var/log/galaxy/uwgi.sock
pythonpath = /home/galaxy/galaxy/lib
pythonhome = /home/galaxy/galaxy/.venv
threads = 4
logto = /var/log/galaxy/uwsgi.log

And this is my supervisord settings:
[program:galaxy_web]
command         = /home/galaxy/galaxy/.venv/bin/uwsgi --ini-paste /home/galaxy/galaxy/config/galaxy.ini
directory       = /home/galaxy/galaxy
umask           = 022
autostart       = true
autorestart     = true
startsecs       = 20
user            = galaxy
environment     = VIRTUAL_ENV="/home/galaxy/galaxy/.venv",PATH="/home/galaxy/galaxy/.venv/bin:%(ENV_PATH)s",PYTHONHOME="/home/galaxy/galaxy/.venv"
numprocs        = 1
stopsignal      = INT
startretries    = 15


The problem is that when I run galaxy with "supervisorctl start galaxy:" I've 4 galaxy process (ps -aux | grep uwsgi):
galaxy   28795 13.0  1.0 1465320 177332 ?      Sl   16:42   0:12 /home/galaxy/galaxy/.venv/bin/uwsgi --ini-paste /home/galaxy/galaxy/config/galaxy.ini
galaxy   28950  1.2  1.0 1465320 170108 ?      Sl   16:42   0:01 /home/galaxy/galaxy/.venv/bin/uwsgi --ini-paste /home/galaxy/galaxy/config/galaxy.ini
galaxy   28951  1.1  1.0 1465320 170108 ?      Sl   16:42   0:01 /home/galaxy/galaxy/.venv/bin/uwsgi --ini-paste /home/galaxy/galaxy/config/galaxy.ini
galaxy   28953  0.0  1.0 1465320 166060 ?      S    16:42   0:00 /home/galaxy/galaxy/.venv/bin/uwsgi --ini-paste /home/galaxy/galaxy/config/galaxy.ini

Once I did "supervisorctl stop galaxy:" I've:
galaxy   28953  0.0  1.0 1465320 166060 ?      S    16:42   0:00 /home/galaxy/galaxy/.venv/bin/uwsgi --ini-paste /home/galaxy/galaxy/config/galaxy.ini

there is still a uwsgi process (sometimes more, it depends on the uwsgi process number).
I'm able to stop only those processes which have a "Sl" in the STAT column of "ps -aux | grep uwsgi":
S    Interruptible sleep (waiting for an event to complete)
l    is multi-threaded (using CLONE_THREAD, like NPTL pthreads do)
(ps wiki)

The problem is that I can't stop all the uwsgi processes, therefore I'm unable to restart galaxy, without killing all uwsgi processes.


Thanks a lot,
Marco.