3 # famd FAM, the File Alteration Monitor server
6 # description: FAM provides a daemon and an API which applications
7 # can use to be notified when specific files or directories
10 # pidfile: /var/run/famd.pid
11 # config: /etc/fam.conf
14 # Source function library
15 . /etc/rc.d/init.d/functions
18 . /etc/sysconfig/network
21 [ -f /etc/sysconfig/famd ] && . /etc/sysconfig/famd
23 # Check that networking is up.
24 if is_yes "${NETWORKING}"; then
25 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
26 msg_network_down "File Alteration Monitor"
33 if [ "$1" != "stop" ]; then
34 check_portmapper || { nls "Error: portmap isn't running" && exit 0; }
38 # Check if the service is already running?
39 if [ ! -f /var/lock/subsys/famd ]; then
40 msg_starting "File Alteration Monitor"
41 daemon famd -T 0 $FAM_OPTS
43 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/famd
45 msg_already_running "File Alteration Monitor"
51 if [ -f /var/lock/subsys/famd ]; then
52 msg_stopping "File Alteration Monitor"
54 rm -f /var/lock/subsys/famd > /dev/null 2>&1
56 msg_not_running "File Alteration Monitor"
61 # See how we were called.
78 msg_usage "$0 {start|stop|restart|force-reload|status}"