我试图编写一个配置文件来运行supervisord和daemonize一些任务。现在,我有一个虚拟程序,它向cli回响"hello“,这样我就知道使用我的conf文件来进行监督了。有两个命令我尝试启动supervisord,一个命令使用我的配置文件,另一个命令不能使用我的配置文件,我不知道为什么。
失败的命令:
sudo service supervisord start --configuration=/current/director/path/supervisord.conf --nodaemon=true结果:
Starting supervisor: supervisord.有效的命令:
sudo supervisord --configuration=/current/directory/path/supervisord.conf结果:
2014-11-10 22:46:07,332 DEBG fd 6 closed, stopped monitoring <POutputDispatcher at 140621301889000 for <Subprocess at 140621301888424 with name flower in state STARTING> (stdout)>
2014-11-10 22:46:07,333 DEBG fd 8 closed, stopped monitoring <POutputDispatcher at 140621301954896 for <Subprocess at 140621301888424 with name flower in state STARTING> (stderr)>
2014-11-10 22:46:07,334 INFO exited: flower (exit status 1; not expected)
2014-11-10 22:46:07,335 DEBG received SIGCLD indicating a child quit
2014-11-10 22:46:08,336 INFO gave up: flower entered FATAL state, too many start retries too quickly
2014-11-10 22:46:28,858 WARN received SIGHUP indicating restart request
2014-11-10 22:47:03,170 CRIT Supervisor running as root (no user in config file)
2014-11-10 22:47:03,175 INFO supervisord started with pid 28776
2014-11-10 22:47:04,178 INFO spawned: 'flower' with pid 28779
2014-11-10 22:47:04,185 DEBG 'flower' stdout output:
hello第二个结果死亡的事实很好,因为我希望它在回显"hello“之后,至少我知道它在指定的路径中使用conf文件。我很困惑为什么第一个命令不使用我的配置文件,两者之间有什么区别呢?
supervisord.conf:
[supervisord]
logfile=/logfile/user/has/access/to/supervisord.log
loglevel=debug
[program:flower]
command=echo hello
process_name=%(program_name)s
autostart=True
autorestart=True发布于 2014-11-10 23:12:16
短版本:它完全忽略了您所提供的参数。
更长版本的:您所指示的第一个命令sudo service supervisord start --configuration=/current/director/path/supervisord.conf --nodaemon=true并不用于在提供参数的方法中接受参数。相反,service使用服务(通常位于/etc/init.d/中)和操作的名称。还可以传递其他参数,这些参数可能因操作系统而异。有关操作系统的详细信息,请参阅手册页(man service)。
要执行的操作通常如下所示:
使用服务命令的正确方法是sudo service supervisord start。这将使用位于/etc/default、/etc/sysconfig、/etc子目录或/etc根目录中的配置文件。位置将是不同的,并且取决于您正在使用的特定linux发行版。
要了解实际发生了什么,导致supervisord运行和退出的详细信息,请签入/var/log,特别是查看文件/var/log/messages (如果存在),或者查看/var/log/syslog,或者查找名称为supervisord的文件或子目录。
https://stackoverflow.com/questions/26854561
复制相似问题