【问题标题】:chef service start_command not working厨师服务 start_command 不起作用
【发布时间】:2015-02-06 14:55:12
【问题描述】:

我正在尝试将节点进程作为永久使用的服务启动,但配置无法正常工作。它有什么问题?

execute "npm install -g forever"

restart_command_string = "forever restart /#{studio_server_folder}/#{studio_server_script}"
reload_command_string = "forever restart /#{studio_server_folder}/#{studio_server_script}"
start_command_string = "forever start /#{studio_server_folder}/#{studio_server_script}"
stop_command_string = "forever stop /#{studio_server_folder}/#{studio_server_script}"
status_command_string = "if [ $(forever list | grep -c \"studio-server\") -gt 0 ]; then echo 1; else echo 0; fi"


# execute "if [ $(forever list | grep -c \"studio-server\") -gt 0 ]; then #{restart_command_string}; else #{start_command}; fi"

service 'studio-server' do
  supports :status => true, :restart => true, :reload => true

  start_command start_command_string
  reload_command reload_command_string
  stop_command stop_command_string
  status_command status_command_string
  restart_command restart_command_string
  action [:start]

end

execute 'service --status-all >> /servicestatus'

【问题讨论】:

  • 任何日志?怎么了 ?输出是什么?你用的是哪个版本的厨师?

标签: service chef-infra daemon forever


【解决方案1】:

该状态命令不是命令,它是 bash 脚本的片段,因此不太可能正常工作。一般来说,我强烈建议使用真正的服务管理器,如 supervisord 或 systemd。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-11-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-10-10
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多