Search code examples
linuxubuntunginxterminalinotify

Using Incrond Inotify but having issues with user groups/permissions


In the /etc/incron.allow I added both:

root
USER_1

Then I edited the incrontab so it looks like this:

/var/www/laravel/public/js/main.js IN_MODIFY yui-compressor -o /var/www/laravel/public/js/main.min.js /var/www/laravel/public/js/main.js

I think the issue may have something to do with permissions or perhaps groups but I'm not sure as I'm not getting anything when I check with tail -f /var/log/syslog

The /var/www/laravel/public folder is owned by USER_1 in group www-data. Incrond Inotify is done by the root user. When the main.js file is updated shouldn't Incrond Inotify run regardless of the current user since it's been set by root? Why isn't it working and how can I make it work with either root or USER_1?


Solution

  • The problem was due to permissions. It required the read and execute access of all parent and child directories to the file. It seems yui-compressor (Java) has to traverse the directories to get to the file. If it can't get to the directory, then it fails.