首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >"sudo服务监督启动“和"sudo supervisord”命令有什么区别?

"sudo服务监督启动“和"sudo supervisord”命令有什么区别?
EN

Stack Overflow用户
提问于 2014-11-10 22:54:48
回答 1查看 3.9K关注 0票数 0

我试图编写一个配置文件来运行supervisord和daemonize一些任务。现在,我有一个虚拟程序,它向cli回响"hello“,这样我就知道使用我的conf文件来进行监督了。有两个命令我尝试启动supervisord,一个命令使用我的配置文件,另一个命令不能使用我的配置文件,我不知道为什么。

失败的命令:

代码语言:javascript
复制
sudo service supervisord start --configuration=/current/director/path/supervisord.conf --nodaemon=true

结果:

代码语言:javascript
复制
 Starting supervisor: supervisord.

有效的命令:

代码语言:javascript
复制
 sudo supervisord --configuration=/current/directory/path/supervisord.conf

结果:

代码语言:javascript
复制
 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:

代码语言:javascript
复制
[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
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 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的文件或子目录。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/26854561

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档