Por que meu supervisord cria muitos dos mesmos processos?

1

Configuração:

[program:aws-mysql]
command=ssh -NCf -L 13306:host1:3306 user@host2
directory=/var/www/ECAME
user=root
autorestart=true
exitcodes=0

status:

# systemctl status supervisord.service
● supervisord.service - Process Monitoring and Control Daemon
   Loaded: loaded (/usr/lib/systemd/system/supervisord.service; enabled; vendor preset: disabled)
   Active: active (running) since Sun 2018-04-15 15:13:22 CST; 24min ago
  Process: 437 ExecStart=/usr/bin/supervisord -c /etc/supervisord.conf (code=exited, status=0/SUCCESS)
 Main PID: 502 (supervisord)
   CGroup: /system.slice/supervisord.service
           ├─ 502 /usr/bin/python /usr/bin/supervisord -c /etc/supervisord.conf
           ├─1892 ssh -NCf -L 13306:host1:3306 user@host2
           ├─1926 ssh -NCf -L 13306:host1:3306 user@host2
           ├─1947 ssh -NCf -L 13306:host1:3306 user@host2
           ├─1967 ssh -NCf -L 13306:host1:3306 user@host2
           ├─1996 ssh -NCf -L 13306:host1:3306 user@host2
           ├─2008 ssh -NCf -L 13306:host1:3306 user@host2
           ├─2037 ssh -NCf -L 13306:host1:3306 user@host2
           ├─2067 ssh -NCf -L 13306:host1:3306 user@host2
           ├─2078 ssh -NCf -L 13306:host1:3306 user@host2
           ├─2111 ssh -NCf -L 13306:host1:3306 user@host2
           ├─2122 ssh -NCf -L 13306:host1:3306 user@host2
           ├─2160 ssh -NCf -L 13306:host1:3306 user@host2
           ├─2180 ssh -NCf -L 13306:host1:3306 user@host2
           ├─2210 ssh -NCf -L 13306:host1:3306 user@host2
           ├─2248 ssh -NCf -L 13306:host1:3306 user@host2
           ├─2260 ssh -NCf -L 13306:host1:3306 user@host2
           ... a lot of " ssh -NCf -L 13306:host2:3306 user@host2"

Então, por que meu supervisord cria muitos dos mesmos processos? Eu acho que deveria haver apenas um ssh -NCf -L 13306:host2:3306 user@host2 .

    
por Sayakiss 15.04.2018 / 09:47

1 resposta

2

O supervisor espera que os subprocessos permaneçam em primeiro plano :

Programs meant to be run under supervisor should not daemonize themselves. Instead, they should run in the foreground. They should not detach from the terminal from which they are started.

Você iniciou ssh com a -f bandeira, que significa :

Requests ssh to go to background just before command execution.

O supervisor acha que o programa fecha e inicia uma nova instância após qualquer limitação. Ele continuará fazendo isso para sempre.

Se você remover o -f flag, ele deverá funcionar como esperado.

    
por 16.04.2018 / 12:13