]> git.pld-linux.org Git - packages/fam.git/blob - fam.init
- include example in -devel
[packages/fam.git] / fam.init
1 #!/bin/sh
2 #
3 # famd          FAM, the File Alteration Monitor server
4 #
5 # chkconfig:    345 75 25
6 # description:  FAM provides a daemon and an API which applications
7 #               can use to be notified when specific files or directories
8 #               are changed.
9 # processname:  famd
10 # pidfile:      /var/run/famd.pid
11 # config:       /etc/fam.conf
12
13
14 # Source function library
15 . /etc/rc.d/init.d/functions
16
17 # Get network config
18 . /etc/sysconfig/network
19
20 # Get service config
21 [ -f /etc/sysconfig/famd ] && . /etc/sysconfig/famd
22
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"
27                 exit 1
28         fi
29 else
30         exit 0
31 fi
32
33 RETVAL=0
34 # See how we were called.
35 case "$1" in
36   start)
37         # Check if the service is already running?
38         if [ ! -f /var/lock/subsys/famd ]; then
39                 msg_starting "File Alteration Monitor"
40                 daemon famd -T 0 $FAM_OPTS
41                 RETVAL=$?
42                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/famd
43         else
44                 msg_already_running "File Alteration Monitor"
45         fi
46         ;;
47   stop)
48         # Stop daemons.
49         if [ -f /var/lock/subsys/famd ]; then
50                 msg_stopping "File Alteration Monitor"
51                 killproc famd
52                 rm -f /var/lock/subsys/famd > /dev/null 2>&1
53         else
54                 msg_not_running "File Alteration Monitor"
55         fi
56         ;;
57   status)
58         status famd
59         exit $?
60         ;;
61   restart|force-reload)
62         $0 stop
63         $0 start
64         exit $?
65         ;;
66   *)
67         msg_usage "$0 {start|stop|restart|force-reload|status}"
68         exit 3
69 esac
70
71 exit $RETVAL
This page took 0.026022 seconds and 3 git commands to generate.