ruby on rails - launching background process in capistrano task -


capistrano task

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

now doesn't work: svscanboot process doesn't run. helped me find sleep: https://github.com/defunkt/resque/issues/284 other sources pointed me nohup, redirection, , pty => true, tried these.

run "nohup svscanboot >/tmp/svscanboot.log 2>&1 &"   # no run "(svscanboot&) && sleep 1"                       # no run "(nohup svscanboot&) && sleep 1"                 # yes! 

now, explain me why need sleep statement , difference nohup make? record above run equally if run user shell, problem in context of capistrano.

thanks

my simple solution make svscanboot.sh file @ remote server whatever code want run. in case

svscanboot >/tmp/svscanboot.log 2>&1 

in cap rake task add

run "sh +x somefile.sh &" 

this works me.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -