Luc Saffre
2016-07-28 16:49:54 UTC
Hi Supervisor users and developers,
this is my first post to this list, so I'd like to first say thanks for
such a great tool. I discovered it a month ago and start to use it more
and more on my production servers. I also wrote about it in my own
documentation: http://www.lino-framework.org/admin/linod.html
But now I discovered my first problem where I hope for your help.
I have a single configuration file written by myself:
$ cat /etc/supervisor/conf.d/linod_prod.conf
[program:prod_linod]
command=/bin/bash /var/www/vhosts/prod/linod.sh
username = www-data
The mentioned bash script contains:
$ cat /var/www/vhosts/prod/linod.sh
#!/bin/bash
set -e # exit on error
cd /var/www/vhosts/prod
. env/bin/activate
python manage.py linod
The process starts and works well. The problem is that Supervisor does
not correctly stop the process. Here is a console session:
$ ps aux | grep linod
1001 15828 0.0 0.0 8344 880 pts/0 S+ 18:07 0:00 grep linod
$ sudo service supervisor start
Starting supervisor: supervisord.
$ ps aux | grep linod
root 16279 0.0 0.0 19720 1668 ? S 18:31 0:00
/bin/bash /var/www/vhosts/prod/linod.sh
root 16284 58.8 0.8 328736 135368 ? S 18:31 0:02 python
manage.py linod
1001 16309 0.0 0.0 8344 884 pts/0 S+ 18:31 0:00 grep linod
Until here it looks good. I am a bit surprised to see two processes
here, but that might be caused by some magic.
The real problem is that Supervisor obviously does not see that spawned
second process and therefore doesn't terminate it. After every restart I
have one additional process running:
$ sudo service supervisor restart
Restarting supervisor: supervisord.
$ ps aux | grep linod
root 16284 6.0 0.8 328736 135368 ? S 18:31 0:02 python
manage.py linod
root 16322 0.0 0.0 19720 1672 ? S 18:32 0:00
/bin/bash /var/www/vhosts/prod/linod.sh
root 16327 106 0.7 306560 115280 ? R 18:32 0:02 python
manage.py linod
1001 16352 0.0 0.0 8344 884 pts/0 S+ 18:32 0:00 grep linod
Yes, I am not using the latest version. I have a default configuration
on a Debian Wheezy VPS:
$ uname -a
Linux SRV-LX1 3.2.0-4-amd64 #1 SMP Debian 3.2.78-1 x86_64 GNU/Linux
$ apt-cache show supervisor
Package: supervisor
State: installed
Version: 3.0a8-1.1+deb7u1
...
Any ideas?
Luc
this is my first post to this list, so I'd like to first say thanks for
such a great tool. I discovered it a month ago and start to use it more
and more on my production servers. I also wrote about it in my own
documentation: http://www.lino-framework.org/admin/linod.html
But now I discovered my first problem where I hope for your help.
I have a single configuration file written by myself:
$ cat /etc/supervisor/conf.d/linod_prod.conf
[program:prod_linod]
command=/bin/bash /var/www/vhosts/prod/linod.sh
username = www-data
The mentioned bash script contains:
$ cat /var/www/vhosts/prod/linod.sh
#!/bin/bash
set -e # exit on error
cd /var/www/vhosts/prod
. env/bin/activate
python manage.py linod
The process starts and works well. The problem is that Supervisor does
not correctly stop the process. Here is a console session:
$ ps aux | grep linod
1001 15828 0.0 0.0 8344 880 pts/0 S+ 18:07 0:00 grep linod
$ sudo service supervisor start
Starting supervisor: supervisord.
$ ps aux | grep linod
root 16279 0.0 0.0 19720 1668 ? S 18:31 0:00
/bin/bash /var/www/vhosts/prod/linod.sh
root 16284 58.8 0.8 328736 135368 ? S 18:31 0:02 python
manage.py linod
1001 16309 0.0 0.0 8344 884 pts/0 S+ 18:31 0:00 grep linod
Until here it looks good. I am a bit surprised to see two processes
here, but that might be caused by some magic.
The real problem is that Supervisor obviously does not see that spawned
second process and therefore doesn't terminate it. After every restart I
have one additional process running:
$ sudo service supervisor restart
Restarting supervisor: supervisord.
$ ps aux | grep linod
root 16284 6.0 0.8 328736 135368 ? S 18:31 0:02 python
manage.py linod
root 16322 0.0 0.0 19720 1672 ? S 18:32 0:00
/bin/bash /var/www/vhosts/prod/linod.sh
root 16327 106 0.7 306560 115280 ? R 18:32 0:02 python
manage.py linod
1001 16352 0.0 0.0 8344 884 pts/0 S+ 18:32 0:00 grep linod
Yes, I am not using the latest version. I have a default configuration
on a Debian Wheezy VPS:
$ uname -a
Linux SRV-LX1 3.2.0-4-amd64 #1 SMP Debian 3.2.78-1 x86_64 GNU/Linux
$ apt-cache show supervisor
Package: supervisor
State: installed
Version: 3.0a8-1.1+deb7u1
...
Any ideas?
Luc