【发布时间】:2013-11-07 06:09:10
【问题描述】:
我在 /etc/init/carbon-cache.conf 创建了 upstart 配置文件来停止/启动/重启 carbon-cache 进程。我可以使用命令启动 carbon-cache 进程:start carbon-cache,但是,我无法使用 stop/restart carbon-cache 并且总是给我错误:“stop: Unknown instance:”。
有谁知道这似乎是什么问题?这是我的新贵配置:/etc/init/carbon-cache.conf
description "Daemonized Carbon-Cache"
start on runlevel [2345]
stop on runlevel [016]
setuid www-data
setgid www-data
exec /opt/graphite/bin/carbon-cache.py start
respawn
respawn limit 10 5
【问题讨论】:
-
这可能与进程启动时正在执行的操作有关。如果它分叉,您应该获得分叉进程的 pid 而不是父进程。使用ps ax | grep carbon 来找出答案。 upstart 中有一个特殊的节 - 期望 - 处理这种情况。阅读此upstart.ubuntu.com/cookbook/#expect
-
我尝试了以下操作,但效果不佳:wiki.xkyle.com/Carbon_Collector
标签: linux ubuntu ubuntu-12.04 upstart graphite