1

In the Supervisord conf files you can specify to autorestart a certain program with:

autorestart=true

But is there an equivalent for [Supervisord] itself? What is the recommended method of making sure Supervisord continues running unconditionally, especially if the Supervisord process gets killed.

Thanks!

4

1 回答 1

3

实际上,您的问题是著名的“Quis custodiet ipsos custodes”的特殊应用?那就是“谁来守卫?”。

在现代 Linux 系统中,中央保护点是init进程(进程号 1)。如果init死了,Linux 内核会立即崩溃,因此你必须去你的数据中心(我的意思是继续前进)并按下reset按钮。有很多替代init实现,这里是那些“比较表”之一:)

如何配置特定init实现的准确答案取决于init您在该系统中使用的版本。例如systemd,有它自己的机制来配置服务在他们死亡时重新启动(指令Restart=RestartSec=WatchdogSec=在相应的单元文件中。其他初始化实现,如 Ubuntu Upstart 也有它的类似物(服务配置文件中的respawn指令)。即使是旧的好的 SysV init 也有respawn中的服务行选项/etc/inittab,但通常用户级服务不直接启动 inittab,只有虚拟控制台管理器(gettymgetty

于 2014-04-26T22:32:37.770 回答