Automatic services reload (inotify)

Whether you are using Linux on the desktop or as a server, it's still good that you're using Linux. Linux related questions go here.

Moderator: General Moderators

Post Reply
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Automatic services reload (inotify)

Post by VladSun »

gat3way has developed a small package called iconf, version "pre-alpha" ;)

Based on inotify kernel feature, it can monitor system files and/or directories for modifications. In case of modification a user defined command is executed.

Configuration files reside in /etc/iconf and have very simple format:

Code: Select all

file_to_be_monitored command_to_be_executed program_parameters
By using iconf services/daemons are automatically reloaded on every modification of their configuration files.
(Have you ever forgotten to execute lilo ;) )

Download link: iconf v0.1

Configuration file sample:

/etc/iconf/general

Code: Select all

/etc/apache /usr/sbin/apachectl restart
/etc/lilo.conf /sbin/lilo
and run /usr/local/bin/iconf :)

PS: Put this line:

Code: Select all

/etc/iconf killall iconf;/usr/local/bin/iconf
in one of your config files in order to have iconf daemon reloaded when its config files has been changed :) :)
There are 10 types of people in this world, those who understand binary and those who don't
Post Reply