Previous incron setup
I found out much to my annoyance that setting up incron to run as a service isn’t quite as easy as I thought as I’ve been suffering with really slow boot ups due to an incrond timeout. Previously I had issued the following commands to get incron to run as a service/daemon.
service incrond start
chkconfig incrond on
I noticed that my box was taking over 5 minutes to boot up. It was actually quite easy to spot such a huge delay. A quick look in the messages log showed me incrond was set to start but never actually achieved it, 5 minutes of waiting for it before it times out and lets the boot continue. The strange thing was that incron was running when I logged in as the replication to my server worked flawlessly.
I won’t go on and explain everything I tried to do to fix it, instead I’ll just show you the end result. Modify the file /etc/init.d/incrond and change the start and stop functions to look like this:
echo -n $"Starting incrond: "
RETVAL=$? echo [ $RETVAL -eq 0 ] && touch /var/lock/subsys/incrond
echo -n $"Stopping incrond: "
echo [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/incrond
The lines affected are in bold. That’s it, nice and simple, everything still works but boot up time is back down to 30 or so seconds which means there are no timeouts.
Hopefully this will be the last post on how to fix problems with this nifty tool, I’d like to start using it to solve quirky problems/scenarios or just never have to write about it again. I find it similar to my motorbike, great when its working but when it fails to start I am less than enamoured by it.