dbus pidfile location varies a little
authorRoy Marples <roy@marples.name>
Thu, 29 Nov 2007 15:52:05 +0000 (15:52 +0000)
committerRoy Marples <roy@marples.name>
Thu, 29 Nov 2007 15:52:05 +0000 (15:52 +0000)
dnsmasq.in

index 027d752263ccda126364a2c4450bce1dd1355ed8..ccb5e3f3e3907353d641bc6d559fa1a0c2f54452 100755 (executable)
@@ -64,15 +64,17 @@ NEWRESOLV="${NEWCONF}"
 # so we need to validate a few things first.
 # Check for DBus support in the binary
 DBUS=no
-if [ -s "${PREFIX}"/var/run/dbus.pid -a -s "${PREFIX}"/var/run/dnsmasq.pid ]; then
+dbuspid=/var/run/dbus/dbus.pid
+[ -s "${dbuspid}" ] || dbuspid=/var/run/dbus.pid
+if [ -s "${dbuspid}" -a -s /var/run/dnsmasq.pid ]; then
        if dnsmasq --version 2>/dev/null | \
                grep -q "^Compile time options.*[[:space:]]DBus[[:space:]]" \
                ; then
                # Sanity - check that dnsmasq and dbus are running
-               if kill -0 $(cat "${PREFIX}"/var/run/dbus.pid) \
-                       && kill -0 $(cat "${PREFIX}"/var/run/dnsmasq.pid); then
+               if kill -0 $(cat "${dbuspid}") \
+                       && kill -0 $(cat /var/run/dnsmasq.pid); then
                        DBUS=yes
-                       NEWCONF="${NEWCONF}\n# Domain specific servers will be sent over dbus\n\nenable-dbus\n"
+                       NEWCONF="${NEWCONF}\n# Domain specific servers will be sent over dbus\nenable-dbus\n"
                fi
        fi
 fi