I have re-written the recursive_chmod-like functions so that they don't call system(). I had a weird issue here where chmod -R would yield lots and lots of permission errors that would just eat up memory in PHP (because it fills the $output variable with it).

Now I have made a generic, recursive function that we can use to extend to even more than chmod/chown/chgrp (chattr?).

Here's a diff: http://git.koumbit.net/?p=drupal/modules/provision/.git;a=commitdiff_pla...

CommentFileSizeAuthor
#1 recursive.patch2.1 KBanarcat
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

anarcat’s picture

FileSize
2.1 KB

Actually, that diff was crap, here's a better patch. I also realised this has the added bonus that it will tell you what the error is as a warning, while chmod -R will not. An example I had here:

warning: chgrp(): Operation not permitted in /srv/aegir/.drush/provision/provision.path.inc on line 374.

aaaaaah! i seee!!!! ;)

This would have been totally hidden by the system call. Now we can even build a list of files that fail and things like that...

I am now using this in production.

anarcat’s picture

Status: Needs review » Fixed

Committed to CVS.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

  • Commit bec5abe on debian, dev-dns, dev-envobject, dev-koumbit, dev-log_directory, dev-migrate_aliases, dev-multiserver-install, dev-newhooks, dev-nginx, dev-platform_management, dev-ports, dev-purgebackup, dev-restore, dev-services, dev-simplerinstaller, dev-site_rename, dev-ssl, dev_716166_apache_conf, dev_dns, dev_server_verify, prod-koumbit, ssl, dev-ssl-ip-allocation-refactor, dev-1205458-move_sites_out_of_platforms, 7.x-3.x, dev-subdir-multiserver, 6.x-2.x-backports, dev-helmo-3.x authored by anarcat:
    #529382 - handle properly arbitrarly long error messages in chmod by...