diff options
author | Andrej Shadura <andrewsh@debian.org> | 2019-01-11 00:11:26 +0100 |
---|---|---|
committer | Andrej Shadura <andrewsh@debian.org> | 2019-01-11 00:11:26 +0100 |
commit | 27607d09ce6de1582b75ac5d6c5da3e49a1f6074 (patch) | |
tree | 3aa5bbe6a56b22ec645b020bd4054ab0a6e7b3ec | |
parent | b20dd2be5780096e4ab9765ce4716ebbe14ef074 (diff) |
Deprecate DAEMON_CONF more prominently
-rw-r--r-- | debian/hostapd.README.Debian | 19 | ||||
-rw-r--r-- | debian/hostapd.default | 3 | ||||
-rw-r--r-- | debian/hostapd.init | 8 | ||||
-rwxr-xr-x | debian/hostapd.postinst | 2 | ||||
-rw-r--r-- | debian/hostapd.service | 3 | ||||
-rw-r--r-- | debian/hostapd@.service | 2 | ||||
-rwxr-xr-x | debian/rules | 4 |
7 files changed, 26 insertions, 15 deletions
diff --git a/debian/hostapd.README.Debian b/debian/hostapd.README.Debian index 3218a61..da5f000 100644 --- a/debian/hostapd.README.Debian +++ b/debian/hostapd.README.Debian @@ -3,7 +3,7 @@ hostapd for Debian This package provides two methods for managing hostapd process(es); an initscript and an ifupdown hook. Both methods require creation of a -hostapd daemon configuration file (eg. /etc/hostapd/hostapd.conf) to +hostapd daemon configuration file (/etc/hostapd/hostapd.conf) to function correctly. An example hostapd.conf may be used as a template but _must_ be edited @@ -15,8 +15,17 @@ To use the example as a template: /etc/hostapd/hostapd.conf # $EDITOR /etc/hostapd/hostapd.conf -To use the initscript method of starting a hostapd daemon see -/etc/default/hostapd. +If you're running systemd, you need to unmask the hostapd unit by running: + + systemctl unmask hostapd + +If you want to run multiple instances of hostapd with different +configurations, consider using a service template hostapd@.service +shipped with the package. E.g. for a hostapd configuration file named +/etc/hostapd/wifi.conf, the service name will be hostapd@wifi.service. + +The previously supported configuration setting DAEMON_CONF in +/etc/default/hostapd is deprecated and its support will be removed. To use the ifupdown method, the path to hostapd configuration file can be specified in a network interfaces configuration stanza in @@ -29,10 +38,6 @@ iface eth1 inet static The hostapd process will be started in the pre-up phase of ifup, and be terminated in the post-down phase of ifdown. - -- Kel Modderman <kel@otaku42.de> Tue, 27 Oct 2009 12:03:01 +1000 - Please note: * If you want to use hostapd with a Prism2/2.5/3 card in WPA mode, you'll need STA firmware version >= 1.7.0. - - -- Faidon Liambotis <faidon@cube.gr>, Mon, 10 Oct 2005 14:57:11 +0300 diff --git a/debian/hostapd.default b/debian/hostapd.default index 1e12174..3e53c4a 100644 --- a/debian/hostapd.default +++ b/debian/hostapd.default @@ -1,5 +1,8 @@ # Defaults for hostapd initscript # +# WARNING: The DAEMON_CONF setting has been deprecated and will be removed +# in future package releases. +# # See /usr/share/doc/hostapd/README.Debian for information about alternative # methods of managing hostapd. # diff --git a/debian/hostapd.init b/debian/hostapd.init index ab6a432..6151f22 100644 --- a/debian/hostapd.init +++ b/debian/hostapd.init @@ -16,7 +16,7 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin DAEMON_SBIN=/usr/sbin/hostapd DAEMON_DEFS=/etc/default/hostapd -DAEMON_CONF= +DAEMON_CONF=/etc/hostapd/hostapd.conf NAME=hostapd DESC="advanced IEEE 802.11 management" PIDFILE=/run/hostapd.pid @@ -25,6 +25,12 @@ PIDFILE=/run/hostapd.pid [ -s "$DAEMON_DEFS" ] && . /etc/default/hostapd [ -n "$DAEMON_CONF" ] || exit 0 +if [ ! -r "$DAEMON_CONF" ] +then + log_action_msg "No hostapd config found, not starting hostapd." + exit 0 +fi + DAEMON_OPTS="-B -P $PIDFILE $DAEMON_OPTS $DAEMON_CONF" . /lib/lsb/init-functions diff --git a/debian/hostapd.postinst b/debian/hostapd.postinst index fe99548..8966f83 100755 --- a/debian/hostapd.postinst +++ b/debian/hostapd.postinst @@ -6,7 +6,7 @@ if [ -d /run/systemd/system ] && [ "$1" = configure ] then DAEMON_CONF= . /etc/default/hostapd - if [ -z "$DAEMON_CONF" ] && ! systemctl --quiet is-active hostapd.service + if [ -z "$DAEMON_CONF" ] && [ ! -r /etc/hostapd/hostapd.conf ] && ! systemctl --quiet is-active hostapd.service then systemctl mask hostapd.service fi diff --git a/debian/hostapd.service b/debian/hostapd.service index f276fef..7fbbc6a 100644 --- a/debian/hostapd.service +++ b/debian/hostapd.service @@ -7,7 +7,8 @@ Type=forking PIDFile=/run/hostapd.pid Restart=on-failure RestartSec=2 -EnvironmentFile=/etc/default/hostapd +Environment=DAEMON_CONF=/etc/hostapd/hostapd.conf +EnvironmentFile=-/etc/default/hostapd ExecStart=/usr/sbin/hostapd -B -P /run/hostapd.pid -B $DAEMON_OPTS ${DAEMON_CONF} [Install] diff --git a/debian/hostapd@.service b/debian/hostapd@.service index 14ed0cc..5ac0377 100644 --- a/debian/hostapd@.service +++ b/debian/hostapd@.service @@ -8,7 +8,7 @@ Type=forking PIDFile=/run/hostapd.%i.pid Restart=on-failure RestartSec=2 -EnvironmentFile=/etc/default/hostapd +EnvironmentFile=-/etc/default/hostapd ExecStart=/usr/sbin/hostapd -B -P /run/hostapd.%i.pid $DAEMON_OPTS /etc/hostapd/%i.conf [Install] diff --git a/debian/rules b/debian/rules index 64c303f..9f68be3 100755 --- a/debian/rules +++ b/debian/rules @@ -91,10 +91,6 @@ override_dh_installchangelogs: dh_installchangelogs --package=hostapd hostapd/ChangeLog dh_installchangelogs --package=wpasupplicant wpa_supplicant/ChangeLog dh_installchangelogs --package=wpagui wpa_supplicant/ChangeLog - -override_dh_installsystemd: - dh_installsystemd --package=hostapd --no-enable --no-start - dh_installsystemd --remaining ### end dh overrides %: |