capistrano task
namespace :service do
desc \"start daemontools (svscan/supervise/svscanboot)\"
task :start, :roles => :app do
sudo \"svscanboot&a
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)