]> git.pld-linux.org Git - packages/avahi.git/commitdiff
- init script
authorfreetz <freetz@pld-linux.org>
Sat, 21 Jan 2006 13:28:45 +0000 (13:28 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    avahi-daemon -> 1.1
    avahi-dnsconfd -> 1.1

avahi-daemon [new file with mode: 0644]
avahi-dnsconfd [new file with mode: 0644]

diff --git a/avahi-daemon b/avahi-daemon
new file mode 100644 (file)
index 0000000..a9eba7a
--- /dev/null
@@ -0,0 +1,89 @@
+#!/bin/sh
+#
+# avahi-daemon:        Starts the Avahi daemon
+#
+# chkconfig:   345 34 66
+#
+# description: This is a daemon which runs on client machines to perform \
+#              Zeroconf service discovery on a network. avahi-daemon must be \
+#              running on systems  that use Avahi for service discovery. \
+#              Avahi-daemon should not be running otherwise.
+#
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+# Get network config
+. /etc/sysconfig/network
+
+# Check that networking is up.
+if is_yes "${NETWORKING}"; then
+       if [ ! -f /var/lock/subsys/network ]; then
+               msg_network_down avahi-daemon
+               exit 1
+       fi
+else
+       exit 0
+fi
+
+
+# See how we were called.
+case "$1" in
+  start)
+       # Check if the service is already running?
+       if [ ! -f /var/lock/subsys/avahi-daemon ]; then
+               msg_starting avahi-daemon
+               daemon --user avahi avahi-daemon
+               RETVAL=$?
+               [ $RETVAL -eq 0 ] && touch /var/lock/subsys/avahi-daemon
+       else
+               msg_already_running avahi-daemon
+       fi
+       ;;
+  stop)
+       if [ -f /var/lock/subsys/avahi-daemon ]; then
+               # Stop daemons.
+               msg_stopping avahi-daemon
+               killproc avahi-daemon
+               rm -f /var/lock/subsys/avahi-daemon
+       else
+               msg_not_running avahi-daemon
+       fi
+       ;;
+  restart)
+       $0 stop
+       $0 start
+       exit $?
+       ;;
+  reload)
+       if [ -f /var/lock/subsys/avahi-daemon ]; then
+               msg_reloading avahi-daemon
+               killproc avahi-daemon -HUP
+               RETVAL=$?
+       else
+               msg_not_running avahi-daemon >&2
+               RETVAL=7
+       fi
+       ;;
+  force-reload)
+       # if program allows reloading without stopping
+       $0 reload
+
+       # or if it doesn't
+       $0 restart
+
+       exit $?
+       ;;
+  status)
+       status avahi-daemon
+       RETVAL=$?
+       ;;
+  *)
+       msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
+       exit 3
+esac
+
+exit $RETVAL
+
+# This must be last line !
+# vi:syntax=sh:tw=78:ts=8:sw=4
diff --git a/avahi-dnsconfd b/avahi-dnsconfd
new file mode 100644 (file)
index 0000000..dbcbf65
--- /dev/null
@@ -0,0 +1,90 @@
+#!/bin/sh
+#
+# avahi-dnsconfd:      Starts the Avahi dns configuration daemon
+#
+# chkconfig:           345 34 66
+#
+# description: avahi-dnsconfd connects to a running avahi-daemon and runs the script \
+#              /etc/avahi/dnsconf.action for each unicast DNS server that is announced \
+#              on the local LAN. This is useful for configuring unicast DNS servers in \
+#              a DHCP-like fashion with mDNS.
+#
+
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+# Get network config
+. /etc/sysconfig/network
+
+# Check that networking is up.
+if is_yes "${NETWORKING}"; then
+       if [ ! -f /var/lock/subsys/network ]; then
+               msg_network_down avahi-dnsconfd
+               exit 1
+       fi
+else
+       exit 0
+fi
+
+
+# See how we were called.
+case "$1" in
+  start)
+       # Check if the service is already running?
+       if [ ! -f /var/lock/subsys/avahi-dnsconfd ]; then
+               msg_starting avahi-dnsconfd
+               daemon --user avahi avahi-dnsconfd
+               RETVAL=$?
+               [ $RETVAL -eq 0 ] && touch /var/lock/subsys/avahi-dnsconfd
+       else
+               msg_already_running avahi-dnsconfd
+       fi
+       ;;
+  stop)
+       if [ -f /var/lock/subsys/avahi-dnsconfd ]; then
+               # Stop daemons.
+               msg_stopping avahi-dnsconfd
+               killproc avahi-dnsconfd
+               rm -f /var/lock/subsys/avahi-dnsconfd
+       else
+               msg_not_running avahi-dnsconfd
+       fi
+       ;;
+  restart)
+       $0 stop
+       $0 start
+       exit $?
+       ;;
+  reload)
+       if [ -f /var/lock/subsys/avahi-dnsconfd ]; then
+               msg_reloading avahi-dnsconfd
+               killproc avahi-dnsconfd -HUP
+               RETVAL=$?
+       else
+               msg_not_running avahi-dnsconfd >&2
+               RETVAL=7
+       fi
+       ;;
+  force-reload)
+       # if program allows reloading without stopping
+       $0 reload
+
+       # or if it doesn't
+       $0 restart
+
+       exit $?
+       ;;
+  status)
+       status avahi-dnsconfd
+       RETVAL=$?
+       ;;
+  *)
+       msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
+       exit 3
+esac
+
+exit $RETVAL
+
+# This must be last line !
+# vi:syntax=sh:tw=78:ts=8:sw=4
This page took 0.091886 seconds and 4 git commands to generate.