Package: hostapd
Version: 2:2.7-3
Severity: normal
Tags: patch

Dear Maintainer,

* What led up to the situation?
   I installed hostapd (first 2.6/testing, then 2.7/unstable) in a system
   with 2 wireless cards. Added 2 configuration files, one for each
   card. Added both files to DAEMON_CONF in /etc/default/hostapd:
   DAEMON_CONF="/etc/hostapd/hostapd-wlp1s0.conf 
/etc/hostapd/hostapd-wlp5s0.conf"
   With this setting, hostapd does not start.

* What exactly did you do (or not do) that was effective (or
  ineffective)?
   - systemctl restart hostapd
   - /etc/init.d/hostapd restart
   - reboot

   a Then I tried removing one file name from DAEMON_CONF.
   b Then I tried starting hostapd manually from the command line:
   #hostapd -B -P /run/hostapd.pid /etc/hostapd/hostapd-wlp1s0.conf 
/etc/hostapd/hostapd-wlp5s0.conf
   c Then I patched the systemd service file /lib/systemd/system/hostapd.service

* What was the outcome of this action?
   - Normal start didn't work, systemctl reported a start failure (see
     below).

   a With only one file name, hostapd started, but managed only one card.
   b hostapd started normally when given the options on the command
     line, and managed both cards.
    
   c Looking at /var/log/syslog, it became clear that something
     (systemd) was passing the arguments to hostapd in the wrong way:

Jan 20 15:27:53 debwall systemd[1]: Starting Advanced IEEE 802.11 AP and IEEE 
802.1X/WPA/WPA2/EAP Authenticator...
Jan 20 15:27:53 debwall hostapd[4468]: Configuration file: 
/etc/hostapd/hostapd-wlp1s0.conf /etc/hostapd/hostapd-wlp5s0.conf
Jan 20 15:27:53 debwall hostapd[4468]: Could not open configuration file 
'/etc/hostapd/hostapd-wlp1s0.conf /etc/hostapd/hostapd-wlp5s0.conf' for reading.
Jan 20 15:27:53 debwall hostapd[4468]: Failed to set up interface with 
/etc/hostapd/hostapd-wlp1s0.conf /etc/hostapd/hostapd-wlp5s0.conf
Jan 20 15:27:53 debwall hostapd[4468]: Failed to initialize interface

   I found the error in /lib/systemd/system/hostapd.service, which calls
   hostapd like this:

   ExecStart=/usr/sbin/hostapd -B -P /run/hostapd.pid -B $DAEMON_OPTS 
${DAEMON_CONF}

   This makes DAEMON_CONF a single string, which leads to the error
   above. Removing the curly brackets solves the problem:

   ExecStart=/usr/sbin/hostapd -B -P /run/hostapd.pid -B $DAEMON_OPTS 
$DAEMON_CONF
   
   See also the attached patch file

   * What outcome did you expect instead?
   hostapd should start and manage both cards.


   Best /markus


-- System Information:
Debian Release: buster/sid
  APT prefers testing
  APT policy: (900, 'testing'), (150, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.19.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL 
set to en_US.utf8), LANGUAGE=en_US:en (charmap=UTF-8) (ignored: LC_ALL set to 
en_US.utf8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages hostapd depends on:
ii  init-system-helpers  1.56+nmu1
ii  libc6                2.28-5
ii  libnl-3-200          3.4.0-1
ii  libnl-genl-3-200     3.4.0-1
ii  libnl-route-3-200    3.4.0-1
ii  libssl1.1            1.1.1a-1
ii  lsb-base             10.2018112800

hostapd recommends no packages.

hostapd suggests no packages.

-- Configuration Files:
/etc/default/hostapd changed [not included]
/etc/init.d/hostapd changed [not included]

-- no debconf information
--- hostapd.service     2019-01-20 15:52:16.827736254 +0100
+++ hostapd.service.patched     2019-01-20 15:52:40.184579690 +0100
@@ -9,7 +9,7 @@
 RestartSec=2
 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}
+ExecStart=/usr/sbin/hostapd -B -P /run/hostapd.pid -B $DAEMON_OPTS $DAEMON_CONF
 
 [Install]
 WantedBy=multi-user.target

Reply via email to