On my Debian Buster system I want to run a bash script when a certain file is modified. I have created and enabled a service in
/etc/systemd/system which looks like this
and the file
watch_file.sh looks like this
while inotifywait -e close_write "path_to_watched_file"
All files are owned by the root user. Things are ok as long as the root user modifies the file. However, I would like to run the script as well when a non-root user modifies the file. Currently, a modification by a user different from root does not trigger the script