I'm trying to make new files and directories within a directory always have the same permissions and group.
I've done this:
cd / sudo mkdir apps sudo chown deploy:www-data apps sudo chmod g+s apps sudo setfacl -d -m g:www-data:rwx apps/ cd apps mkdir foo ls -lah foo
I get the correct permissions and group ownership for foo:
drwxrwsr-x+ 2 deploy www-data 4.0K Apr 22 17:29 foo
However, if I do this:
mkdir -p /apps/bar
... I get the correct group ownership, but not the group permissions:
drwxr-sr-x+ 2 deploy www-data 4.0K Apr 22 17:30 bar
There is clearly something I do not understand in the way ACLs work. I can't find why the second directory does not have rwx group permissions.