【发布时间】:2019-03-24 01:21:20
【问题描述】:
我正在使用 launchd 来启动 supervisord,然后再启动一个小的 python 文件,这是一个连接到 reddit 的机器人。
每当 supervisord 使用此方法启动时,它都会立即发送 SIGKILL。当我手动启动 supervisord 时,这个过程会正常启动,并且会一直工作到手动退出。
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)
【问题讨论】:
-
显示您正在使用的启动配置将是一个起点-尽管也许更好的方法是追踪 SIGTERM 的来源(因此我们可以尝试弄清楚这是否" modbot" 尝试杀死其父级,或者如果出于某种原因将launchd 配置为尝试杀死其子级)。
-
Re:追踪信号的来源,参见 dtrace 脚本brendangregg.com/DTrace/kill.d(Apple 确实提供 dtrace,即使它比以前更难使用在他们采取安全措施限制 root 的权力之前)。
-
...尽管如此,您要求我们调试您未向我们展示的配置;问题本身需要包含足够的信息来重现问题,以符合minimal reproducible example 定义。
-
非常感谢您的帮助,我最初没有发布 conf 文件,因为如果我自己启动 supervisord,而不是使用 launchd,它就可以工作。所以我认为问题出在某个地方,我可能应该发布那个ini文件。我最终放弃并重新安装了所有东西,它奏效了。再次感谢您的宝贵时间。
标签: python macos supervisord