diff options
author | doktornotor <notordoktor@gmail.com> | 2015-08-12 09:31:16 +0200 |
---|---|---|
committer | doktornotor <notordoktor@gmail.com> | 2015-08-12 09:31:16 +0200 |
commit | e4370bba8fd5849751b3411e218c50c076b4d9a3 (patch) | |
tree | f43ef5cf9f25a1bd66766e0e022e06b0518c9e39 /config/avahi | |
parent | 0b6889b49d2518e0e639a66332e04970f23aa0e4 (diff) | |
download | pfsense-packages-e4370bba8fd5849751b3411e218c50c076b4d9a3.tar.gz pfsense-packages-e4370bba8fd5849751b3411e218c50c076b4d9a3.tar.bz2 pfsense-packages-e4370bba8fd5849751b3411e218c50c076b4d9a3.zip |
avahi - add option to disable D-BUS client API
Diffstat (limited to 'config/avahi')
-rw-r--r-- | config/avahi/avahi.inc | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/config/avahi/avahi.inc b/config/avahi/avahi.inc index e9e75f5d..7d69af78 100644 --- a/config/avahi/avahi.inc +++ b/config/avahi/avahi.inc @@ -89,6 +89,7 @@ function avahi_write_config() { $denyif = $config['installedpackages']['avahi']['config'][0]['denyinterfaces']; $useipv4 = ($config['installedpackages']['avahi']['config'][0]['disable_ipv4']) ? "no" : "yes"; $useipv6 = ($config['installedpackages']['avahi']['config'][0]['disable_ipv6']) ? "no" : "yes"; + $usedbus = ($config['installedpackages']['avahi']['config'][0]['disable_dbus']) ? "no" : "yes"; // No supplied domains? Use the defaults. if (!$browsedomains) { @@ -123,7 +124,7 @@ browse-domains={$browsedomains} deny-interfaces={$denyinterfaces} use-ipv4={$useipv4} use-ipv6={$useipv6} -enable-dbus=yes +enable-dbus={$usedbus} #check-response-ttl=no #use-iff-running=no #disallow-other-stacks=no @@ -175,24 +176,28 @@ EOF; $start .= "if [ ! -f /usr/local/etc/gnome.subr ]; then\n"; $start .= " /bin/ln -sf " . AVAHI_BASE . "/etc/gnome.subr /usr/local/etc/gnome.subr\n"; $start .= "fi\n"; - $start .= "if [ ! -d /var/run/dbus ]; then\n"; - $start .= " /bin/mkdir /var/run/dbus\n"; - $start .= " /usr/sbin/chown messagebus:messagebus /var/run/dbus\n"; - $start .= "fi\n"; $start .= "/usr/bin/killall avahi-daemon >/dev/null 2>&1\n"; - if (file_exists(AVAHI_BASE . "/etc/rc.d/dbus")) { - $start .= AVAHI_BASE . "/etc/rc.d/dbus onestop\n"; - $start .= "/bin/rm /var/run/dbus/dbus.pid >/dev/null 2>&1\n"; - $start .= AVAHI_BASE . "/etc/rc.d/dbus onestart\n"; + if (!$config['installedpackages']['avahi']['config'][0]['disable_dbus']) { + $start .= "if [ ! -d /var/run/dbus ]; then\n"; + $start .= " /bin/mkdir /var/run/dbus\n"; + $start .= " /usr/sbin/chown messagebus:messagebus /var/run/dbus\n"; + $start .= "fi\n"; + if (file_exists(AVAHI_BASE . "/etc/rc.d/dbus")) { + $start .= AVAHI_BASE . "/etc/rc.d/dbus onestop\n"; + $start .= "/bin/rm /var/run/dbus/dbus.pid >/dev/null 2>&1\n"; + $start .= AVAHI_BASE . "/etc/rc.d/dbus onestart\n"; + $start .= "sleep 5\n"; + } } - $start .= "sleep 5\n"; $start .= AVAHI_BASE . "/sbin/avahi-daemon -D\n"; $start .= "/etc/rc.conf_mount_ro\n"; $stop = "/usr/bin/killall avahi-daemon >/dev/null 2>&1\n"; - if (file_exists(AVAHI_BASE . "/etc/rc.d/dbus")) { - $stop .= AVAHI_BASE . "/etc/rc.d/dbus onestop\n"; - $stop .= "/bin/rm /var/run/dbus/dbus.pid >/dev/null 2>&1\n"; + if (!$config['installedpackages']['avahi']['config'][0]['disable_dbus']) { + if (file_exists(AVAHI_BASE . "/etc/rc.d/dbus")) { + $stop .= AVAHI_BASE . "/etc/rc.d/dbus onestop\n"; + $stop .= "/bin/rm /var/run/dbus/dbus.pid >/dev/null 2>&1\n"; + } } write_rcfile(array( |