]> git.pld-linux.org Git - packages/am-utils.git/blob - am-utils.init
- LSB compliance
[packages/am-utils.git] / am-utils.init
1 #!/bin/sh
2 #
3 # chkconfig:    345 72 28
4 # description:  Runs the automount daemon that mounts devices and NFS hosts \
5 #               on demand.
6 # processname:  amd
7 # config:       /etc/amd.conf
8
9 # Source function library.
10 . /etc/rc.d/init.d/functions
11
12 # Demon specified configuration.
13 . /etc/sysconfig/amd
14
15 # See how we were called.
16 case "$1" in
17   start)
18         # Check if the service is already running?
19         if [ ! -f /var/lock/subsys/amd ]; then
20                 msg_starting amd
21                 daemon /usr/sbin/amd -a $ADIR -l syslog $AMDOPTS -c 1000 $MOUNTPTS
22                 RETVAL=$?
23                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/amd
24         else
25                 msg_already_running Amavisd
26         fi
27         ;;
28   stop)
29         if [ -f /var/lock/subsys/amd ]; then
30                 msg_stopping amd
31                 killproc amd
32                 rm -f /var/lock/subsys/amd
33         else
34                 msg_not_running Amavisd
35         fi
36         ;;
37   status)
38         status amd
39         exit $?
40         ;;
41   restart)
42         $0 stop
43         $0 start
44         exit $?
45         ;;
46   reload|force-reload)
47         if [ -f /var/lock/subsys/amd ]; then
48                 msg_reloading amd
49                 killproc -HUP amd
50                 RETVAL=$?
51         else
52                 msg_not_running Amavisd >&2
53                 RETVAL=7
54         fi
55         ;;
56   *)
57         msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
58         exit 3
59 esac
60
61 exit $RETVAL
This page took 0.031416 seconds and 4 git commands to generate.