我正在使用launchd启动supervisor,后者又启动了一个小的python文件,这是一个连接到reddit的机器人。
每当主管使用此方法启动时,它都会发送即时SIGKILL。当我手动启动supervisor时,此过程可以正常运行,并且可以正常运行,直到手动退出为止。
2019-03-23 21:06:49,519 CRIT Supervisor is running as root. Privileges were not dropped because no user is specified in the config file. If you intend to run as root, you can set user=root in the config file to avoid this message.
2019-03-23 21:06:49,519 INFO Increased RLIMIT_NOFILE limit to 1024
2019-03-23 21:06:49,537 INFO RPC interface 'supervisor' initialized
2019-03-23 21:06:49,538 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2019-03-23 21:06:49,542 INFO daemonizing the supervisord process
2019-03-23 21:06:49,584 INFO supervisord started with pid 142
2019-03-23 21:06:50,653 INFO spawned: 'modbot' with pid 143
2019-03-23 21:06:50,655 WARN received SIGTERM indicating exit request
2019-03-23 21:06:50,656 INFO waiting for modbot to die
2019-03-23 21:06:53,965 INFO waiting for modbot to die
2019-03-23 21:06:57,084 INFO waiting for modbot to die
2019-03-23 21:07:00,232 INFO waiting for modbot to die
2019-03-23 21:07:01,278 WARN killing 'modbot' (143) with SIGKILL
2019-03-23 21:07:01,349 INFO stopped: modbot (terminated by SIGKILL)
答案 0 :(得分:0)
最有可能(这是猜测,因为您没有在问题中包括已启动的配置),没有将-n
参数传递给主管以防止已启动的配置进行自我守护进程。
当程序的主PID退出时,启动程序会考虑与孤儿相关的其余进程,并清理它们。
为避免这种情况,请从不将在监督系统下运行的软件配置为自守护,除非该监督系统明确支持并遵循以下子项。