Replies: 2 comments 7 replies
-
Current procedure in writable.php is to
This only works if all the directories and files are created by the deploy user. This is not the case for shared directories, as these might contain directories/files that are created by the web user (www-data). The correct procedure should be
Another simple solution could be to just follow the current procedure, but add the -f option to chgrp/chown commands, as this will silence these errors and the deploy will at least not break unnecessarily. Hope this clarifies a little. I am not sure why this is moved to discussion @antonmedv. This is more a bug report or issue and is highly related to the code itself, not so much about discussion of the usage of depoyer in general. |
Beta Was this translation helpful? Give feedback.
-
I looked into it some more, and I see two possible solutions.
This will cause shared_dirs to have deploy:deploy owner, while we need deploy:www-data ownership. Therefore, permissions have to be fixed at the moment of creation:
Looking forward to hear some feedback! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
A while after the first deploy, I wanted to update, so did a deploy again. In the mean time, the web user (www-data) added some files to some of the shared_dirs, also making some subdirectories. These files and directories are created with owner www-data:www-data and this should not be a problem.
Now, trying to deploy, the dep deploy returns an extended list of all those files and directories with e.g.
chgrp: changing group of 'pub/media/tmp/design/file': Operation not permitted
The deploy process is ran from the user 'deploy' with the following settings:
Effectively, the command that is executed by the deploy user is
chgrp -H -R www-data writable_dirs
, however, chgrp is not allowed on files or directories that are not owned by the user calling it. Since the new files are created by www-data:www-data, this command fails, even thought the group actually already is www-data. So, the complete deploy fails, while nothing is wrong with the file permissions.How can this be solved? Is this caused by the overlap of shared_dirs and writable_dirs? I can imagine that permissions do not have to be repeatedly set for shared_dirs, as those are not created again for each deploy. So only the first deploy should set permissions for shared_dirs AND writable_dirs, but subsequent deploys should only set permissions for writable_dirs that are NOT shared_dirs (with one exception, in case the shared_dirs have changed, the new directories have to be created and permissions have te be set).
Beta Was this translation helpful? Give feedback.
All reactions