Supervisor Does Not Run Killed Processes

I have a supervisord installed on my Ubuntu 10.04, and it runs the Java process continuously and needs to heal (restart) the process when it somehow dies or crashes.

In my htop I send SIGKILL, SIGTERM, SIGHUP, SIGSEGV for this Java process and look at the /etc/logs/supervisord.log file and it says.

 08:09:46,182 INFO success: myprogram entered RUNNING state,[...] 08:38:10,043 INFO exited: myprogram (exit status 0; expected) 

At 08:38 I kill the process with SIGSEGV. How is it that he came out with code 0 and why does he not supervisord restart it at all?

All my supervisord.conf about this particular program are as follows:

 [program:play-9000] command=play run /var/www/myprogram/ --%%prod stderr_logfile = /var/log/supervisord/myprogram-stderr.log stdout_logfile = /var/log/supervisord/myprogram-stdout.log 

The process works very well when I start the supervisor, but it does not heal.

By the way, what ideas start the supervisor as a service so that it starts automatically when the entire system reboots?

+6
source share
1 answer

Try setting autorestart=true . By default, autorestart is set to "unexpected", which means that it will only restart the process if it exists with an unexpected exit code. By default, exit code 0 is expected.

http://supervisord.org/configuration.html#program-x-section-settings

You can use the chkconfig program to verify that the supervisor is starting a reboot.

 $ sudo apt-get install chkconfig $ chkconfig -l supervisor supervisor 0:off 1:off 2:on 3:on 4:on 5:on 6:off 

You can see that it is turned on for runlevels 2-5 by default when I installed it.

 $ man 7 runlevel 

for more information on runlevels.

+11
source

Source: https://habr.com/ru/post/900125/


All Articles