You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem is that background simply nohup and backgrounds the process using the shell's job control &. More often than not, badly behaved daemons still block.
There's many hoops to jump through to ensure that your process behaves well when backgrounded, forked, nohupped, etc - and we can't whitelist programs that do it well, and blacklist those that can't.
Discussion is welcome, but I do think that background() should be removed from the DSL.
The text was updated successfully, but these errors were encountered:
I agree. IMHO daemons should be managed by the init process, not by Capistrano deploy tasks.
Exactly, there's some legacy here, it used to be used for mongrel script/runner, and if you monitor a service with something like Monit, then starting it with Capistrano does make sense, sometimes.
What's the suggested way to execute a command in background? Or is it discouraged?
@maxwxzheng It is discouraged. SSHKit is typically used to deploy long-running processes, like app servers or job processors. In such a scenario, simply firing off the command in the background and hoping it stays running is not a good idea. What if the process dies? What if the server is rebooted? Instead, you should use a process manager like systemd which handles these things for you.
sshkit/lib/sshkit/backends/abstract.rb
Line 59 in 6c81f53
The problem is that background simply
nohup
and backgrounds the process using the shell's job control&
. More often than not, badly behaved daemons still block.There's many hoops to jump through to ensure that your process behaves well when backgrounded, forked, nohupped, etc - and we can't whitelist programs that do it well, and blacklist those that can't.
Discussion is welcome, but I do think that
background()
should be removed from the DSL.The text was updated successfully, but these errors were encountered: