Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FS#3218 - hostapd log_level ingored #8061

Open
openwrt-bot opened this issue Jul 8, 2020 · 10 comments
Open

FS#3218 - hostapd log_level ingored #8061

openwrt-bot opened this issue Jul 8, 2020 · 10 comments
Labels
flyspray release/19.07 pull request/issue targeted (also) for OpenWrt 19.07 release

Comments

@openwrt-bot
Copy link

coelner:

Model: TP-Link Archer C7 v2
Architecture: Qualcomm Atheros QCA9558 ver 1 rev 0
Firmware Version :OpenWrt 19.07.2 r10947-65030d81f3 / LuCI openwrt-19.07 branch git-20.155.55664-f35803e
Kernel Version: 4.14.171

root@router:/tmp/run# uci show wireless | grep log wireless.radio0.log_level='3' wireless.radio1.log_level='3' root@router:/tmp/run# cat hostapd-phy* | grep log logger_syslog=127 logger_syslog_level=3 logger_stdout=127 logger_stdout_level=3 logger_syslog=127 logger_syslog_level=3 logger_stdout=127 logger_stdout_level=3 root@router:/tmp/run# hostapd_cli -i wlan0 log_level Current level: INFO Timestamp: 0 root@router:/tmp/run# hostapd_cli -i wlan1 log_level Current level: INFO Timestamp: 0 root@router:/tmp/run# hostapd_cli -i wlan1-1 log_level Current level: INFO Timestamp: 0 root@router:/tmp/run# hostapd_cli -i wlan1-1 log_level 2 FAIL root@router:/tmp/run# opkg list-installed | grep hostapd hostapd-common - 2019-08-08-ca8c2bd2-4 hostapd-utils - 2019-08-08-ca8c2bd2-4 root@router:/tmp/run# opkg list-installed | grep wpad wpad - 2019-08-08-ca8c2bd2-4

Hello, I have a problem with the loglevel of hostapd. However the loglevel get ignored by the daemon and even the direct manipulation over hostapd_cli failed. Because of this the syslog get spammed by all the info messages.
It is predefined here: https://github.com/openwrt/openwrt/blob/openwrt-19.07/package/network/services/hostapd/Config.in
But I don't know why it is unchangeable at all

@openwrt-bot
Copy link
Author

coelner:

I build the 19.07.3 version from the github branch and set the default value to 4.

Actually this changes nothing, the ringbuffer from logd contains all messages. That leads me to this topic: https://forum.openwrt.org/t/logd-doesnt-honor-conloglevel-17-01-4-r3560-79f57e422d/8196/7

@openwrt-bot
Copy link
Author

rmelotte:

I also noticed the log_level is ignored, even if you set it through UCI.
uci set wireless.radio0.log_level=1 correctly sets it in /var/run/hostapd_phyX.conf, but the log level used by hostapd stays the same (INFO).

As for why the hostapd_cli call you pasted doesn't work, it's because it uses the level name instead of a number.
So to set it to level 4, try:

hostapd_cli -i wlan0 log_level ERROR

The available levels are:

Following priority levels are used:

  • 0 = MSGDUMP
  • 1 = DEBUG
  • 2 = INFO
  • 3 = WARNING
  • 4 = ERROR

@openwrt-bot
Copy link
Author

coelner:

thanks for the hint with the hostapd_cli and for confirming the bug

@openwrt-bot
Copy link
Author

coelner:

the bug exists furthermore under 21.02

@aparcar aparcar added the release/19.07 pull request/issue targeted (also) for OpenWrt 19.07 release label Feb 22, 2022
@jvdsn
Copy link

jvdsn commented Sep 10, 2022

Issue still exists on 22.03.0. The following script in /etc/hotplug.d/iface/ can be used as a workaround (hostapd-utils needs to be installed)

#!/bin/sh

[ "$ACTION" = ifup ] || exit 0

hostapd_cli -i wlan0 log_level ERROR
hostapd_cli -i wlan1 log_level ERROR

@zsw
Copy link

zsw commented Jan 22, 2024

Is this bug still found in 23.05.0? Adding "option log_level '4'" to /etc/config/wireless doesn't seem to work. For the 'hostapd_cli', I don't see the package 'hostapd-utils', ie 'opkg search hostapd_cli'.

@jvdsn
Copy link

jvdsn commented Jan 23, 2024

@zsw yes, this issue still exists in 23.05.2. I have hostapd-utils on my 23.05.0 system, but that might be because I use the imagebuilder to build my image.

@jvdsn
Copy link

jvdsn commented Jan 23, 2024

I had to update my script though, because the interface name changed:

#!/bin/sh

[ "$ACTION" = ifup ] || exit 0
[ "$INTERFACE" = wan ] || exit 0

hostapd_cli -i phy0-ap0 log_level ERROR
hostapd_cli -i phy1-ap0 log_level ERROR

@martin-eq
Copy link

I had to update my script though, because the interface name changed:

#!/bin/sh

[ "$ACTION" = ifup ] || exit 0
[ "$INTERFACE" = wan ] || exit 0

hostapd_cli -i phy0-ap0 log_level ERROR
hostapd_cli -i phy1-ap0 log_level ERROR

This script works great for the built-in wlan interfaces, thanks for sharing this!
But I have a minor issue, it doesn't apply the same log level to a new interface I created for a guest wlan network called phy0-ap1. I added an extra hostapd_cli command for that interface but it still logs info messages 😢 any idea how to fix that?

@jvdsn
Copy link

jvdsn commented Jan 25, 2024

@martin-eq is the interface name different? That script will only execute after the wan interface is brought up. If the phy0-ap1 doesn't yet exist at that point, then hostapd_cli won't work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flyspray release/19.07 pull request/issue targeted (also) for OpenWrt 19.07 release
Projects
None yet
Development

No branches or pull requests

5 participants