I have the following problem: I make some automated changes in my webserver config (through a web interface) and I want to restart the apache. Since none of the actions are performed by root I cannot start the server directly.
My current workaround is to have a cronjob(every minute) for root that checks if a specific file exists (/tmp/restart.txt). If the file exists, it is deleted and the apache is restarted.
This can be invoked by other users by simply touching the file
$ touch /tmp/restart.txt
My question now is: Can I avoid the cronjob and somehow create a listener that gets invoked everytime the mtime of the file changes? This would be a better solution in my opinion.