I'm trying to use monit to monitor irexec but I cannot figure out
where I'm going wrong. I use monit for mythbackend and it works well.
The problem I have is sometimes irexec just dies and I want something
to restart this automatically. Irexec doesn't create a pid file so I
had to do this so from there I added the irexec to my monitrc file. I
also wrote a script to start irexec and this always comes back as fail
when trying to start irexec. Yet I can run the command from the
command line.
Here's the start script
#!/bin/sh
# let's remove the current pid file since it's a start
if [ -f /var/run/irexec/irexec.pid ]; then
rm /var/run/irexec/irexec.pid
fi
#mkdir for the pid file
mkdir -p /var/run/irexec
chown mythtv /var/run/irexec
#killall irexec processes
killall irexec
sleep 1
DISPLAY=:0 /usr/bin/irexec -d /home/mythtv/.lircrc
sleep 1
#create new pid file
pgrep irexec > /var/run/irexec/irexec.pid
exit 0
irexec runs as a user so in my monitrc file I have this to run as
mythtv
I thought my irexec command issue was a display issue so I added the
display in the front but this didn't solve the problem.
To stop irexec, I just have a killall command running as root.
Can someone point me in the right direction?
--
To unsubscribe:
http://lists.nongnu.org/mailman/listinfo/monit-general