Apologies for Daanβs belated reply. Your understanding of Capistrano is correct. Also note that the :use_sudo flag is true by default.
In Capistrano 2.11.2 you will find lib / capistrano / configuration / variables.rb:
_cset(:run_method) { fetch(:use_sudo, true) ? :sudo : :run }
and lib / capistrano / recipes / deploy.rb:
def try_sudo(*args) options = args.last.is_a?(Hash) ? args.pop : {} command = args.shift raise ArgumentError, "too many arguments" if args.any? as = options.fetch(:as, fetch(:admin_runner, nil)) via = fetch(:run_method, :sudo) if command invoke_command(command, :via => via, :as => as) elsif via == :sudo sudo(:as => as) else "" end end
Perhaps your permission problem is related to your server acting as a normal user, unable to read the contents of the release directory referenced by the current symlink?
source share