I'm having trouble getting incron to run properly. I have incron installed, and the daemon is running. However, incrond is not actually executing the commands in my incrontab. I thought maybe it was a problem with my script (which runs fine on Linux Mint with incrontab), so I'm just trying it out with simple commands and it's still not working. I know from this thread that I have to use full paths so I'm doing just that
- My user is in /etc/incron.allow
- My incrontab contains the following:
/home/kevin/foobar IN_CLOSE_WRITE /usr/bin/notify-send Hi Hi
- I can edit the file /home/kevin/foobar and after doing so I see the following line in the journal (and nothing else, e.g. there don't appear to be any permission errors):
Aug 06 11:21:57 pooter incrond: (kevin) CMD (/usr/bin/notify-send Hi Hi)
However, nothing happens. If I run '/usr/bin/notify-send Hi Hi' in a terminal, I get the usual popup. Even if I change the incrontab from notify-send to
/home/kevin/foobar IN_CLOSE_WRITE /usr/bin/echo test > /tmp/test
then there's nothing in /tmp/test after changing the file, even though incrond shows up in the journal again.
I have to be doing (or not doing) something stupid, but I can't figure it out. Any ideas what I could be doing wrong?
Last edited by lumpy211 (2013-08-06 15:36:14)
Heya.. Sorry I wasn't around when you were asking, but for other future users with issues: use strace and/or journalctl -n to get an inkling on what might be an issue.
If you get a error with file, or so, it is probably because one has used tabs instead of a space between the 3 args. Also, I found it easiest to writea wrapper which incrond calls with $@ say, (where one can throw in one's commands).
I am hilariously insane. yup. you won't notice though.. I promise...I think.
I think it is the problem that it tryes to run notify-send as root user..so you never get it..When i tryed to run as su schef -c /home/schef/test.sh i get Perminion denied in journalctl -n. But it writes to a file..