launching background process in capistrano task

前端 未结 5 720
傲寒
傲寒 2020-12-29 11:59

capistrano task

namespace :service do
  desc \"start daemontools (svscan/supervise/svscanboot)\"
  task :start, :roles => :app do
    sudo \"svscanboot&a         


        
5条回答
  •  盖世英雄少女心
    2020-12-29 12:52

    I'd like to share my solution which also works when executing multiple commands. I tried many other variants found online, including the "sleep N" hack.

    run("nohup sh -c 'cd #{release_path} && bundle exec rake task_namespace:task_name RAILS_ENV=production > ~/shared/log/.log &' > /dev/null 2>&1", :pty => true)
    

提交回复
热议问题