11

System: ( lsb_release -a )

Distributor ID: Ubuntu
Description:    Ubuntu 10.04.4 LTS
Release:        10.04
Codename:       lucid

This is my command:

sudo chmod +a "www-data allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs

Docs:

Error:

chmod: invalid mode: `+a'
Try `chmod --help' for more information.

Why doesn't this work? Isn't the +a standard chmod?

UPDATE:

Looks like this is a OSX only mod:

1
  • try +x instead of +a
    – Ashu
    Jun 5, 2012 at 13:48

2 Answers 2

17

"+a" is not a standard argument, no. Follow the next step in the linked documentation.

sudo setfacl -R -m u:www-data:rwx -m u:`whoami`:rwx app/cache app/logs
sudo setfacl -dR -m u:www-data:rwx -m u:`whoami`:rwx app/cache app/logs

Info on what the "+a" does for chmods that use it:

+a The +a mode parses a new ACL entry from the next argument on the commandline and inserts it into the canonical location in the ACL. If the supplied entry refers to an identity already listed, the two entries are combined.

1
  • link is here symfony.com/doc/3.4/setup/file_permissions.html HTTPDUSER=$(ps axo user,comm | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1) sudo setfacl -dR -m u:"$HTTPDUSER":rwX -m u:$(whoami):rwX var sudo setfacl -R -m u:"$HTTPDUSER":rwX -m u:$(whoami):rwX var
    – Daniel
    Oct 12, 2018 at 13:39
2

That is Mac OS X syntax. See here for proof.
Ubuntu's chmod doesn't include this option.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .