]> git.meshlink.io Git - catta/blobdiff - initscript/debian/avahi-dnsconfd.in
Rework DBus connection handling: use a private DBusConnection instead of a shared...
[catta] / initscript / debian / avahi-dnsconfd.in
index d100d177573a571a142ca8e0e7e97df50f28a838..ee63e06730ffbcc64851deafa2a72408a11fbf66 100755 (executable)
@@ -83,10 +83,19 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin
 DESC="Avahi Unicast DNS Configuration Daemon"
 NAME="avahi-dnsconfd"
 DAEMON="@sbindir@/$NAME"
+SCRIPTNAME=/etc/init.d/$NAME
 
 # Gracefully exit if the package has been removed.
 test -x $DAEMON || exit 0
 
+# don't start if /etc/default/avahi-dnsconfd says so.
+AVAHI_DNSCONFD_START=1
+test -f /etc/default/avahi-dnsconfd && . /etc/default/avahi-dnsconfd
+
+if [ "$AVAHI_DNSCONFD_START" != "1" -a "$1" != "stop" ]; then
+    exit 0
+fi
+
 #
 #       Function that starts the daemon/service.
 #
@@ -150,7 +159,7 @@ case "$1" in
         ;;
     reload|restart|force-reload)
         log_begin_msg "Restarting $DESC: $NAME"
-        d_stop
+        $DAEMON -c && d_stop
         d_start
         log_end_msg $?
         ;;