Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/55.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 在部署时杀死unicorn进程_Ruby On Rails_Bash_Unicorn - Fatal编程技术网

Ruby on rails 在部署时杀死unicorn进程

Ruby on rails 在部署时杀死unicorn进程,ruby-on-rails,bash,unicorn,Ruby On Rails,Bash,Unicorn,我正在尝试将unicorn添加到我的应用程序中,在我的部署脚本中添加了以下几行: namespace :deploy do task :restart do run "if [ -f #{unicorn_pid} ] && [ -e /proc/$(cat #{unicorn_pid}) ]; then kill -0 `cat #{unicorn_pid}`; else cd #{deploy_to}/current && bundle exec u

我正在尝试将unicorn添加到我的应用程序中,在我的部署脚本中添加了以下几行:

namespace :deploy do
  task :restart do
    run "if [ -f #{unicorn_pid} ] && [ -e /proc/$(cat #{unicorn_pid}) ]; then kill -0 `cat #{unicorn_pid}`; else cd #{deploy_to}/current && bundle exec unicorn_rails -c #{unicorn_conf} -E #{rails_env} -D; fi"
  end
  task :start do
    run "bundle exec unicorn_rails -c #{unicorn_conf} -E #{rails_env} -D"
  end
  task :stop do
    run "if [ -f #{unicorn_pid} ] && [ -e /proc/$(cat #{unicorn_pid}) ]; then kill -QUIT `cat #{unicorn_pid}`; fi"
  end

  task :load_rvm do
    run '[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"' # Load RVM into a shell session *as a function*
  end
end
但是,当我运行部署脚本时,在任务“重新启动”上出现以下错误:


Kill命令不会使用-0选项。必须是-9

kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]