运行 supervisord 从启动时使用自定义配置文件

Run supervisord with custom configuration file from startup

我正在使用 this article 作为让我完成一半的来源,但我不知道如何 运行 主管使用自定义配置文件路径。

当我想手动 运行 supervisor 时,我只是这样做:

supervisord -c /home/test/_app/supervisord.conf

当我实现自动启动脚本时,它 运行 是位于 /etc/ 目录中的默认主管配置文件。我不想使用那个,因为它将它与核心项目文件夹分开,并且难以维护和跟踪。

试试这个:

/etc/rc.d/init.d/supervisord 中,添加 prog_opts 变量,如下所示:

prog_opts=" -c /home/test/_app/supervisord.conf"
prog_bin="${exec_prefix}/bin/supervisord"

然后在start()函数中,将调用更改为:

daemon $prog_bin --pidfile $PIDFILE -- $prog_opts

我能够通过简单地删除默认 supervisord.conf 文件然后使用该默认位置和我的自定义 conf 文件路径创建一个 sym link 来解决这个问题。