Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Permission issue using ACL #65

Open
yellowmamba opened this issue Jul 4, 2016 · 3 comments
Open

Permission issue using ACL #65

yellowmamba opened this issue Jul 4, 2016 · 3 comments

Comments

@yellowmamba
Copy link

Hi there,

I use ACL to set permissions on certain directories upon deployment. Here's the part of deploy.rb:

set :linked_files, ['app/config/parameters.yml']
set :linked_dirs, ["app/logs", "web/uploads"]

set :permission_method, :acl
set :file_permissions_paths, ["app/logs", "app/cache", "web/uploads"]
set :file_permissions_users, ["www-data"]

before "deploy:updated", "deploy:set_permissions:acl"

So this works on the first deployment, when you set up your directories where nothing has been created inside them yet. However, after some time, say you uploaded an image to the web/uploads directory, the file would be under the www-data user, while the directory is still owned by the deploy user. So when you deploy code again, capistrano will fail because it attempts to run acl on a directory that contains files owned by www-data.

How can I work around this?

@wasbaiti
Copy link

Hello,
I have exactly the same problem.
I tried using chmod, works fine first time, but capistrano can not delete old releases because cache directory contains files owned by www-data.

Really appreciate if someone can help with that.

@yellowmamba
Copy link
Author

@wasbaiti I don't have this issue on deleting old releases due to the cache folder. Did you set up permissions correctly? http://symfony.com/doc/current/setup/file_permissions.html. Note you need to give permissions to both web server user and your whoami user for cache and/or log folder.

@wasbaiti
Copy link

@yellowmamba : I did set up permissions for my first release, capistrano did delete this release, bun fail to do same thing on other releases.
to work around the problem, I add a task that executes commands explained in the documentation and now it works fine.
I noticed that the difference is in the command options.
That of Capistrano, used -n and without this option it works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants