]> git.pld-linux.org Git - packages/avahi.git/blob - avahi-daemon
- don't enable howl compat layer for now
[packages/avahi.git] / avahi-daemon
1 #!/bin/sh
2 #
3 # avahi-daemon: Starts the Avahi daemon
4 #
5 # chkconfig:    345 34 66
6 #
7 # description:  This is a daemon which runs on client machines to perform \
8 #               Zeroconf service discovery on a network. avahi-daemon must be \
9 #               running on systems  that use Avahi for service discovery. \
10 #               Avahi-daemon should not be running otherwise.
11 #
12
13 # Source function library
14 . /etc/rc.d/init.d/functions
15
16 # Get network config
17 . /etc/sysconfig/network
18
19 # Check that networking is up.
20 if is_yes "${NETWORKING}"; then
21         if [ ! -f /var/lock/subsys/network ]; then
22                 msg_network_down avahi-daemon
23                 exit 1
24         fi
25 else
26         exit 0
27 fi
28
29
30 # See how we were called.
31 case "$1" in
32   start)
33         # Check if the service is already running?
34         if [ ! -f /var/lock/subsys/avahi-daemon ]; then
35                 msg_starting avahi-daemon
36                 daemon --user avahi avahi-daemon
37                 RETVAL=$?
38                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/avahi-daemon
39         else
40                 msg_already_running avahi-daemon
41         fi
42         ;;
43   stop)
44         if [ -f /var/lock/subsys/avahi-daemon ]; then
45                 # Stop daemons.
46                 msg_stopping avahi-daemon
47                 killproc avahi-daemon
48                 rm -f /var/lock/subsys/avahi-daemon
49         else
50                 msg_not_running avahi-daemon
51         fi
52         ;;
53   restart)
54         $0 stop
55         $0 start
56         exit $?
57         ;;
58   reload)
59         if [ -f /var/lock/subsys/avahi-daemon ]; then
60                 msg_reloading avahi-daemon
61                 killproc avahi-daemon -HUP
62                 RETVAL=$?
63         else
64                 msg_not_running avahi-daemon >&2
65                 RETVAL=7
66         fi
67         ;;
68   force-reload)
69         $0 reload
70         exit $?
71         ;;
72   status)
73         status avahi-daemon
74         RETVAL=$?
75         ;;
76   *)
77         msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
78         exit 3
79 esac
80
81 exit $RETVAL
82
83 # This must be last line !
84 # vi:syntax=sh:tw=78:ts=8:sw=4
This page took 0.09273 seconds and 3 git commands to generate.