I've got a Linux permission issue. It's causing me more hassle than anything else in my project but it a relatively minor feature.
I've got two scripts. One runs as the "pi" user. The other is a Flask app running under a NGINX/uwsgi setup. It runs as "www-data".
The first script creates a directory and fills it with images.
I want the second script to be able to delete this directory when running a particular function.
Once created the directory is owned by the "pi" user with the group "pi". The permissions for pi:pi are rwxrwxr-x.
I've added the "www-data" user to the "pi" group. So as far as I can see the "www-data" user should be able to delete anything the "pi" user creates as it is in the "pi" group. So should have rwx permission on the directory.
But when I use
It fails to remove the directory.
Code: Select all
If I run the same code as the "pi" user it removes the directory as expected.
Have I missed anything? Is there anything else I need to consider?