Friday, August 27, 2010

Failed Shell Script When Running Pidof With Capistrano

Error: failed: "sh -c 'pidof /path/to/app'" on IP

Description: I was deploying my app using capistrano and I was trying to find the pid of a specific program running. I didn't know that pidof returned an exit code of 1 if no program was found with the requested name What this means is that capistrano was receiving a  bad shell command or a failed shell command.


Fix: run "[ `pidof /path/to/app` ] && (echo 'found') || (echo 'not found')", :via => run_method, :as => as

No comments:

Post a Comment