Processed: Re: Bug#928948: hostapd: syslog is spammed every two seconds

2019-06-02 Thread Debian Bug Tracking System
Processing control commands:

> tags -1 pending
Bug #928948 [hostapd] hostapd: syslog is spammed every two seconds
Added tag(s) pending.

-- 
928948: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=928948
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems



Bug#928948: hostapd: syslog is spammed every two seconds

2019-06-02 Thread Andrej Shadura
Control: tags -1 pending

Hi,

On Mon, 3 Jun 2019 at 03:36, Reinhard Tartler  wrote:
> I'm trying to help out with remaining RC bugs for buster.
>
> > The postinst is set up in a way so that if /etc/hostapd/hostapd.conf
> > is not readable or missing, the hostapd.service is masked during the
> > package installation unless it was already running.
>
> I wonder if that is really necessary and couldn't be avoided by using the 
> following drectitve in hostapd.service:
>
> ConditionPathExists=/etc/hostapd/hostapd.conf
>
> If my understading of systemd.unit(5) is correct, I believe this might 
> simplify significantly simplify the postinst script.

Your understanding is correct, but, unfortunately, we cannot do that
for buster since there’s no guarantee users are going to have their
configuration file there. For bullseye, this is going to be the plan.

I will upload a fix later today.

-- 
Cheers,
  Andrej



Bug#928948: hostapd: syslog is spammed every two seconds

2019-06-02 Thread Reinhard Tartler
Hi,

I'm trying to help out with remaining RC bugs for buster.

> The postinst is set up in a way so that if /etc/hostapd/hostapd.conf
> is not readable or missing, the hostapd.service is masked during the
> package installation unless it was already running.

I wonder if that is really necessary and couldn't be avoided by using the
following drectitve in hostapd.service:

ConditionPathExists=/etc/hostapd/hostapd.conf

If my understading of systemd.unit(5) is correct, I believe this might
simplify significantly simplify the postinst script.

-- 
regards,
Reinhard


Bug#928948: hostapd: syslog is spammed every two seconds

2019-05-28 Thread Kristofer Hansson
Hi.

I did some digging into this and it seems that the issue is that the
debhelper includes sections from dh_installsystemd which both unmasks and
starts the service (irregardless of what has been done before).

A quick-and-dirty fix to this is to move the debhelper section in
debian/hostapd.postinst before the check if the package should be masked (I
tested this and it worked for me). The problem with this is that systemd
will try to activate the service once before masking it and that it relies
on the fact that hostapd has died before running the check.

What I decided to do for myself was to override the dh_installsystemd
target in the rules file and install it as an else if the package was not
decided to be masked. I'm not sure if this is what the package maintainer
aims to do with the postinst, but it should solve the problem described in
the bug.

I've attached a patch with the aforementioned fix, the patch is built on
d569f1dda5f4bd1c4b36bb438dc94fd6c85a6def (2:2.7+git20190128+0c1e29f-5)
commit 44d1af878437cb9becac07ec59a6b3591cf08606
Author: Kristofer Hansson 
Date:   Tue May 28 13:27:45 2019 +

wpa (2:2.7+git20190128+0c1e29f-5+nmu1) unstable; urgency=medium

* Made sure that hostapd is unmasked if no config available.
(Closes: #928948)

diff --git a/debian/changelog b/debian/changelog
index 35a81f4..72a2389 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+wpa (2:2.7+git20190128+0c1e29f-5+nmu1) unstable; urgency=medium
+
+  * Made sure that hostapd is unmasked if no config available.
+(Closes: #928948)
+
+ -- Kristofer Hansson   Tue, 28 May 2019 13:26:31 +
+
 wpa (2:2.7+git20190128+0c1e29f-5) unstable; urgency=high
 
   * Fix security issue 2019-5:
diff --git a/debian/hostapd.postinst.post-systemd b/debian/hostapd.postinst.post-systemd
new file mode 100644
index 000..6ed40de
--- /dev/null
+++ b/debian/hostapd.postinst.post-systemd
@@ -0,0 +1,2 @@
+fi
+fi
\ No newline at end of file
diff --git a/debian/hostapd.postinst b/debian/hostapd.postinst.pre-systemd
old mode 100755
new mode 100644
similarity index 72%
rename from debian/hostapd.postinst
rename to debian/hostapd.postinst.pre-systemd
index 8966f83..45e0cc8
--- a/debian/hostapd.postinst
+++ b/debian/hostapd.postinst.pre-systemd
@@ -1,16 +1,8 @@
-#!/bin/sh
-
-set -e
-
 if [ -d /run/systemd/system ] && [ "$1" = configure ]
 then
 DAEMON_CONF=
 . /etc/default/hostapd
 if [ -z "$DAEMON_CONF" ] && [ ! -r /etc/hostapd/hostapd.conf ] && ! systemctl --quiet is-active hostapd.service
 then
-	systemctl mask hostapd.service
-fi
-fi
-
-#DEBHELPER#
-exit 0
+systemctl mask hostapd.service
+else
diff --git a/debian/rules b/debian/rules
index 9f68be3..cd78839 100755
--- a/debian/rules
+++ b/debian/rules
@@ -87,6 +87,11 @@ override_dh_install:
 	install --mode=755 -D wpa_supplicant/wpa_supplicant-udeb \
 		debian/wpasupplicant-udeb/sbin/wpa_supplicant
 
+override_dh_installsystemd:
+	cat debian/hostapd.postinst.pre-systemd >> debian/.debhelper/generated/hostapd/postinst.service
+	dh_installsystemd
+	cat debian/hostapd.postinst.post-systemd >> debian/.debhelper/generated/hostapd/postinst.service
+
 override_dh_installchangelogs:
 	dh_installchangelogs --package=hostapd hostapd/ChangeLog
 	dh_installchangelogs --package=wpasupplicant wpa_supplicant/ChangeLog


Bug#928948: hostapd: syslog is spammed every two seconds

2019-05-20 Thread sergio
On 13/05/2019 22:51, Andrej Shadura wrote:

> Could you please provide more details?

# l /etc/hostapd
ls: cannot access '/etc/hostapd': No such file or directory


# apt policy hostapd
hostapd:
  Installed: (none)
  Candidate: 2:2.7+git20190128+0c1e29f-5
  Version table:
 2:2.7+git20190128+0c1e29f-5 500
500 https://deb.debian.org/debian buster/main amd64 Packages


# apt policy
Package files:
 100 /var/lib/dpkg/status
 release a=now
 400 https://deb.debian.org/debian buster-proposed-updates/main amd64
Packages
 release
o=Debian,a=testing-proposed-updates,n=buster-proposed-updates,l=Debian,c=main,b=amd64
 origin deb.debian.org
 500 https://deb.debian.org/debian-security buster/updates/main amd64
Packages
 release o=Debian,a=testing,n=buster,l=Debian-Security,c=main,b=amd64
 origin deb.debian.org
 500 https://deb.debian.org/debian buster/non-free amd64 Packages
 release o=Debian,a=testing,n=buster,l=Debian,c=non-free,b=amd64
 origin deb.debian.org
 500 https://deb.debian.org/debian buster/contrib amd64 Packages
 release o=Debian,a=testing,n=buster,l=Debian,c=contrib,b=amd64
 origin deb.debian.org
 500 https://deb.debian.org/debian buster/main amd64 Packages
 release o=Debian,a=testing,n=buster,l=Debian,c=main,b=amd64
 origin deb.debian.org
Pinned packages:


# apt install hostapd
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  hostapd
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 778 kB of archives.
After this operation, 2082 kB of additional disk space will be used.
Get:1 https://cdn-aws.deb.debian.org/debian buster/main amd64 hostapd
amd64 2:2.7+git20190128+0c1e29f-5 [778 kB]
Fetched 778 kB in 1s (700 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package hostapd.
(Reading database ... 42783 files and directories currently installed.)
Preparing to unpack .../hostapd_2%3a2.7+git20190128+0c1e29f-5_amd64.deb ...
Unpacking hostapd (2:2.7+git20190128+0c1e29f-5) ...
Setting up hostapd (2:2.7+git20190128+0c1e29f-5) ...
Created symlink /etc/systemd/system/hostapd.service → /dev/null.
Created symlink
/etc/systemd/system/multi-user.target.wants/hostapd.service →
/lib/systemd/system/hostapd.service.
Job for hostapd.service failed because the control process exited with
error code.
See "systemctl status hostapd.service" and "journalctl -xe" for details.
Processing triggers for man-db (2.8.5-2) ...
Processing triggers for systemd (241-3) ...
Scanning processes...

Scanning candidates...

Scanning processor microcode...

Scanning linux images...


Running kernel seems to be up-to-date.

The processor microcode seems to be up-to-date.

Restarting services...

Service restarts being deferred:
 systemctl restart libvirtd.service

No containers need to be restarted.

No user sessions are running outdated binaries.

# tail -f /var/log/syslog | grep hostap
systemd[1]: hostapd.service: Service RestartSec=2s expired, scheduling
restart.
systemd[1]: hostapd.service: Scheduled restart job, restart counter is
at 71.
hostapd[24428]: Configuration file: /etc/hostapd/hostapd.conf
hostapd[24428]: Could not open configuration file
'/etc/hostapd/hostapd.conf' for reading.
hostapd[24428]: Failed to set up interface with /etc/hostapd/hostapd.conf
hostapd[24428]: Failed to initialize interface
systemd[1]: hostapd.service: Control process exited, code=exited,
status=1/FAILURE
systemd[1]: hostapd.service: Failed with result 'exit-code'.
systemd[1]: hostapd.service: Service RestartSec=2s expired, scheduling
restart.
systemd[1]: hostapd.service: Scheduled restart job, restart counter is
at 72.
hostapd[24429]: Configuration file: /etc/hostapd/hostapd.conf
hostapd[24429]: Could not open configuration file
'/etc/hostapd/hostapd.conf' for reading.
hostapd[24429]: Failed to set up interface with /etc/hostapd/hostapd.conf
hostapd[24429]: Failed to initialize interface
systemd[1]: hostapd.service: Control process exited, code=exited,
status=1/FAILURE
systemd[1]: hostapd.service: Failed with result 'exit-code'.



> The postinst is set up in a way so that if /etc/hostapd/hostapd.conf
> is not readable or missing, the hostapd.service is masked during the
> package installation unless it was already running.

Looks like it's not masked.


> From what you wrote it sounds like the package hasn’t been installed
> before, but then it wouldn’t run by default.

The package was installed before, than purged, configs were removed.


-- 
sergio.



Bug#928948: hostapd: syslog is spammed every two seconds

2019-05-13 Thread Andrej Shadura
Hi,

On Mon, 13 May 2019 at 21:42, sergio  wrote:
> Dear Maintainer,
>
> after installing hostap on debian buster syslog begin sapammed every
> 2 seconds with:
>
> systemd[1]: hostapd.service: Service RestartSec=2s expired, scheduling 
> restart.
> systemd[1]: hostapd.service: Scheduled restart job, restart counter is at 72.
> systemd[1]: Stopped Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP 
> Authenticator.
> systemd[1]: Starting Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP 
> Authenticator...
> hostapd[3500]: Configuration file: /etc/hostapd/hostapd.conf
> hostapd[3500]: Could not open configuration file '/etc/hostapd/hostapd.conf' 
> for reading.
> hostapd[3500]: Failed to set up interface with /etc/hostapd/hostapd.conf
> hostapd[3500]: Failed to initialize interface
> systemd[1]: hostapd.service: Control process exited, code=exited, 
> status=1/FAILURE
> systemd[1]: hostapd.service: Failed with result 'exit-code'.
> systemd[1]: Failed to start Advanced IEEE 802.11 AP and IEEE 
> 802.1X/WPA/WPA2/EAP Authenticator.

Could you please provide more details?

The postinst is set up in a way so that if /etc/hostapd/hostapd.conf
is not readable or missing, the hostapd.service is masked during the
package installation unless it was already running.

>From what you wrote it sounds like the package hasn’t been installed
before, but then it wouldn’t run by default.

-- 
Cheers,
  Andrej



Bug#928948: hostapd: syslog is spammed every two seconds

2019-05-13 Thread sergio
Package: hostapd
Version: 2:2.7+git20190128+0c1e29f-5
Severity: serious

Dear Maintainer,

after installing hostap on debian buster syslog begin sapammed every
2 seconds with:

systemd[1]: hostapd.service: Service RestartSec=2s expired, scheduling restart.
systemd[1]: hostapd.service: Scheduled restart job, restart counter is at 72.
systemd[1]: Stopped Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP 
Authenticator.
systemd[1]: Starting Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP 
Authenticator...
hostapd[3500]: Configuration file: /etc/hostapd/hostapd.conf
hostapd[3500]: Could not open configuration file '/etc/hostapd/hostapd.conf' 
for reading.
hostapd[3500]: Failed to set up interface with /etc/hostapd/hostapd.conf
hostapd[3500]: Failed to initialize interface
systemd[1]: hostapd.service: Control process exited, code=exited, 
status=1/FAILURE
systemd[1]: hostapd.service: Failed with result 'exit-code'.
systemd[1]: Failed to start Advanced IEEE 802.11 AP and IEEE 
802.1X/WPA/WPA2/EAP Authenticator.