Supervisor / supervisor

Supervisor process control system for Unix (supervisord)
http://supervisord.org
Other
8.53k stars 1.25k forks source link

The supervisorctl stop command is invalid #1607

Open EayonLee opened 1 year ago

EayonLee commented 1 year ago

When I use the supervisorctl stop command I can't stop the corresponding process

Here is the configuration of my process

[program:sae-core]
command=sh /opt/qihoo/soc/sae-core/sae_core_start.sh
environment=JAVA_OPTS="-Xms3g -Xmx3g"
priority=230
process_name=%(program_name)s
autostart=true
startsecs=30
user=root
redirect_stderr=true
stdout_logfile_maxbytes=10MB
stdout_logfile_backups=10
stdout_logfile=/opt/qihoo/soc/sae-core/logs/sae-core_supervisord.log

This is the sae_core_start.sh script executed

#!/usr/bin/env bash

name=lbrain-sae-core
if docker ps -a --filter name=${name} -q | grep -q .; then
    docker stop ${name} && docker rm ${name}
fi
sae_core_port=8765

docker create -p ${sae_core_port}:${sae_core_port} --privileged=true --network=host -v /opt/qihoo/soc/sae-core/application.yml:/opt/qihoo/soc/sae_core/application.yml -v /etc/localtime:/etc/localtime:ro  -v /opt/sae-core/logs:/opt/qihoo/soc/sae-core/logs -v /opt/qihoo/soc/etc:/opt/qihoo/soc/etc -v /opt/qihoo/soc/sock:/tmp -e JAVA_OTPS=${JAVA_OTPS}   --name ${name} lbrain-sae-core:3.5

exec docker start -a ${name}

It's actually executing a script through supervisord, in which a docker container is launched When I use supervisorctl to go to start or any other command it works fine. But I can't stop the container when I run the stop command. Although the container is not stopped, the supervisord prompts that it is stopped

[root@docker01v supervisor]# supervisorctl stop sae-core
sae-core: stopped
[root@docker01v supervisor]# supervisorctl status | grep sae-core
sae-core                         STOPPED   Nov 01 10:15 AM
[root@docker01v supervisor]# docker ps -a | grep sae-core
21f694859293   lbrain-sae-core:3.5                    "/docker-entrypoint.…"   About a minute ago   Up About a minute         lbrain-sae-core

I tried to go kill -9 on sae-core's pid and it doesn't stop the container.

[root@docker01v supervisor]# supervisorctl status | grep sae
sae-core                         RUNNING   pid 8274, uptime 0:00:35
[root@docker01v supervisor]# ps aux | grep sae
root      8274 10.2  0.0 936964 23804 ?        Sl   10:23   0:04 docker start -a lbrain-sae-core
[root@docker01v supervisor]# kill -9 8274
[root@docker01v supervisor]# supervisorctl status | grep sae
sae-core                         STARTING
[root@docker01v supervisor]# docker ps -a | grep sae
a3371db6fe78   lbrain-sae-core:3.5                    "/docker-entrypoint.…"   About a minute ago   Up About a minute      lbrain-sae-core