views:

27

answers:

1

In my Capistrano deploy.rb, I have a couple of daemons like delayed_jobs and fetcher, starting and stopping depending on where they are in the deployment process.

This method would create problems if a deployment fails, because the daemons wouldn't be managed properly (ie. two processes spawned instead of one, or processes were shutdown without restarting itself until the next deployment).

Is there anyway to prevent this from happening like a rollback code? How is deployment of daemons normally done over capistrano?

A: 

Capistrano allows you to define an on_rollback hook for each task. You can also group tasks in a Transaction to rollback all tasks if one of them fails.

Ken Liu