augustash / capistrano-ash

August Ash recipes for Capistrano
http://augustash.com
MIT License
73 stars 12 forks source link

Drupal Shared Hosting Setup and Deploy breaks on set_perms_dir. #51

Open dficker opened 11 years ago

dficker commented 11 years ago

Trying to setup or deploy to staging, the set_perms_dir command does not work. This error shows up:

failed: "sh -c 'find /home/aaidura/domains/durasupreme.com/staging/releases/20131105194229 -type d -print0 | xargs -0 sudo -p '\\''sudo password: '\\'' chmod 755'" on victor.aaiserver.net

The error is thus:

Sorry, user aaidura is not allowed to execute '/bin/chmod 755 lots_of_dir_paths  as root on victor.aaiserver.net.
dficker commented 11 years ago

All of the files it's trying to change are owned by aaidura and therefore should be settable without using sudo, in this case. Unless, well, the file is not writeable and/or owned by another user, I guess.

dficker commented 11 years ago

I added this to my Capfile and this worked:

namespace :ash do
  desc "Set standard permissions for Ash servers"
  task :fixperms, :roles => :web, :except => { :no_release => true } do
    # chmod the files and directories.
#    set_perms_dirs("#{latest_release}")
    run "find #{latest_release} -type d -print0 | xargs -0 chmod 755" if remote_dir_exists?(latest_release)
#    set_perms_files("#{latest_release}")
    run "find #{latest_release} -type f -print0 | xargs -0 chmod 644" if remote_dir_exists?(latest_release)
  end
end
grafikchaos commented 11 years ago

Duplicate of #50

dficker commented 11 years ago

This is still not fixed. #50 seems to fix something in setup, this ticket needs some fixes in ash:fixperms.

dficker commented 11 years ago

Also, it's not a fatal error, but it also tries to do a sudo chmod on the backups/tmp/{release} folder and that does error out. Again, it doesn't halt the whole script, so it's not as important of an issue.