Skip to main content
Topic: Small problem with wpa_supplicant (Read 2165 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Small problem with wpa_supplicant

So far I'm loving the quick boot times and how everything is working on my new system. There's just been two small problems.

First, what I need technical help for, wpa_supplicant has been outputting its progress  to tty1 as text in starting up as well as the information about my wifi device (wlp2s0). I'm using NetworkManager with runit to do wifi so I'm not sure why it's doing that by default.

Second, my touchpad isn't recognized by the latest kernel and so I had to downgrade to an earlier kernel. Does anyone know an rss feed for the linux kernel or a place to find that bug and track it with email or something else? I just want to know when I can run with the latest version. The particular touchpad picked up by libinput after downgrade is  SYNA7DB5:01 06CB:7DB7

Thanks for all the help! If I need to provide any logs just let me know


Re: Small problem with wpa_supplicant

Reply #2
This is due to no logging being set up for some runit services that require it:
https://forum.artixlinux.org/index.php/topic,1171.msg8432.html#msg8432

There are various instructions around about doing this e.g.
https://wiki.archlinux.org/index.php/Runit
http://smarden.org/runit/faq.html

Code: [Select]
$ pacman -Fl wpa_supplicant-runit
wpa_supplicant-runit etc/
wpa_supplicant-runit etc/runit/
wpa_supplicant-runit etc/runit/sv/
wpa_supplicant-runit etc/runit/sv/wpa_supplicant/
wpa_supplicant-runit etc/runit/sv/wpa_supplicant/run

So someone would need to add a suitable /etc/runit/sv/wpa_supplicant/log symlink or file or something like that, to the service package, or you could add one yourself, and also for any other services that did this, to fix it properly. There are also rsvlog and nsvlog helpers according to the Arch wiki but the packages mentioned don't seem to be in the repos or AUR.

And there are several other workarounds possible, eg add -f /var/log/logfilename -t to the wpa_supplicant args and it will log to your logfile not stdout, although you would need to make a logrotate entry for the file too.

Looks like Void builds wpa_supplicant with syslog logging enabled, which isn't done here as the -s arg doesn't work:
# Send debug messages to syslog instead of stdout
CONFIG_DEBUG_SYSLOG=y
https://github.com/void-linux/void-packages/blob/master/srcpkgs/wpa_supplicant/files/config

Probably something similar for the other services.

Re: Small problem with wpa_supplicant

Reply #3
This is due to no logging being set up for some runit services that require it:
https://forum.artixlinux.org/index.php/topic,1171.msg8432.html#msg8432

There are various instructions around about doing this e.g.
https://wiki.archlinux.org/index.php/Runit
http://smarden.org/runit/faq.html

Code: [Select]
$ pacman -Fl wpa_supplicant-runit
wpa_supplicant-runit etc/
wpa_supplicant-runit etc/runit/
wpa_supplicant-runit etc/runit/sv/
wpa_supplicant-runit etc/runit/sv/wpa_supplicant/
wpa_supplicant-runit etc/runit/sv/wpa_supplicant/run

So someone would need to add a suitable /etc/runit/sv/wpa_supplicant/log symlink or file or something like that, to the service package, or you could add one yourself, and also for any other services that did this, to fix it properly. There are also rsvlog and nsvlog helpers according to the Arch wiki but the packages mentioned don't seem to be in the repos or AUR.

And there are several other workarounds possible, eg add -f /var/log/logfilename -t to the wpa_supplicant args and it will log to your logfile not stdout, although you would need to make a logrotate entry for the file too.

Looks like Void builds wpa_supplicant with syslog logging enabled, which isn't done here as the -s arg doesn't work:
# Send debug messages to syslog instead of stdout
CONFIG_DEBUG_SYSLOG=y
https://github.com/void-linux/void-packages/blob/master/srcpkgs/wpa_supplicant/files/config

Probably something similar for the other services.
Thanks for the help! Also thanks to @SGOrava for letting me know about the bugzilla spot.

Since I'm running wpa_supplicant through NetworkManager instead of as an individual service. I.e. I have no /run/runit/sv/wpa_supplicant. How does that change how I would go about doing this? I tried adding a log setup with svlogd to the NetworkManager service but it didn't solve the issue.

Re: Small problem with wpa_supplicant

Reply #4
Perhaps the easiest way to keep wpa_supplicant quiet given the existing situation, from the perspective of an Artix user, until a less hacky fix is suggested, might be to create the file /usr/local/bin/wpa_supplicant with this content:

Code: [Select]
#!/usr/bin/bash

/usr/bin/wpa_supplicant -f /dev/null "$@"

then make it executable:

Code: [Select]
$ sudo chmod a+x /usr/local/bin/wpa_supplicant

Then (hopefully, works with my usual setup, but not tested with Network Manager!) it will act as a wrapper script to add the extra -f /dev/null  arg which will log to /dev/null, and then add on whatever other args were supplied and pass the result to the real /usr/bin/wpa_supplicant.
For a more global distro wide solution ... where's Konimex?   ;)

Re: Small problem with wpa_supplicant

Reply #5
Perhaps the easiest way to keep wpa_supplicant quiet given the existing situation, from the perspective of an Artix user, until a less hacky fix is suggested, might be to create the file /usr/local/bin/wpa_supplicant with this content:

Code: [Select]
#!/usr/bin/bash

/usr/bin/wpa_supplicant -f /dev/null "$@"

then make it executable:

Code: [Select]
$ sudo chmod a+x /usr/local/bin/wpa_supplicant

Then (hopefully, works with my usual setup, but not tested with Network Manager!) it will act as a wrapper script to add the extra -f /dev/null  arg which will log to /dev/null, and then add on whatever other args were supplied and pass the result to the real /usr/bin/wpa_supplicant.
For a more global distro wide solution ... where's Konimex?   ;)
I tried this solution but it didn't work because NetworkManager directly calls /usr/bin/wpa_supplicant with the full filepath

Doing some digging myself as to the cause of the issue. It seems that NetworkManager, regardless of if it's executed with runit or by hand, will spawn a wpa_supplicant process as a child process of PID 1 (in this case runit).

In order to circumvent this I've moved wpa_supplicant to my /usr/local/bin directory and made a file wpa_sup there with your script (modified of course to point to the original wpa_supplicant). I've then symlinked /usr/bin/wpa_supplicant to /usr/local/bin/wpa_sup

This worked as expected

Obviously this is a non-ideal solution so I'd like to see what can be done that's more nice. Thanks for the help though!

Re: Small problem with wpa_supplicant

Reply #6
Well I guess it means rebuilding wpa_supplicant then:
Code: [Select]
$ git clone https://gitea.artixlinux.org/packagesW/wpa_supplicant.git
$ cd wpa_supplicant/repos/core-x86_64
$ makepkg -o wpa_supplicant

edit config file that is in PKGBUILD dir, add:
CONFIG_DEBUG_SYSLOG=y
CONFIG_DEBUG_SYSLOG_FACILITY=LOG_DAEMON

redo the sha sum for the PKGBUILD or change it to 'SKIP'

$ sha256sum config
30078f2b9a6469c95ab8633ff33ab72450f7a651277b06ad978a722571154742  config

PKGBUILD:
sha256sums=('fcbdee7b4a64bea8177973299c8c824419c413ec2e3a95db63dd6a5dc3541f17'
            'SKIP'
#            '23aee0597750ec21b37654b5163e2f577c1204fc33bdfbf7bc2fb470e8a467db')
            '30078f2b9a6469c95ab8633ff33ab72450f7a651277b06ad978a722571154742')

$ makepkg -C
$ sudo pacman -U wpa_supplicant-2\:2.9-3-x86_64.pkg.tar.xz

The wpa_supplicant default config is found in src/wpa_supplicant-2.9/wpa_supplicant/defconfig if you wanted to look at what other build options are possible. There is another option that removes all debug output for example.
You could probably skip the makepkg -o / -C 2 stage bit and mod the config and PKGBUILD then run makepkg, but I was looking at the source first.
Running wpa_supplicant in the foreground in a terminal, it still prints to the terminal though, after I remembered to get rid of the earlier /usr/local/bin script. But now you can use -s to log to syslog. I suppose it would be possible to patch wpa_supplicant to be quiet by default, or patch NetworkManager to supply different args. I didn't see any config options to do this in the NM docs, whether that is possible somehow. The Void runit runfile is almost the same, apart from some extra dir checks in the Artix one.
Does it help with the Network Manager case?

Re: Small problem with wpa_supplicant

Reply #7
Quote
Since I'm running wpa_supplicant through NetworkManager instead of as an individual service. I.e. I have no /run/runit/sv/wpa_supplicant. How does that change how I would go about doing this? I tried adding a log setup with svlogd to the NetworkManager service but it didn't solve the issue.

I think you hit the real problem there, it SHOULD be a service and communicate with NetworkManager through dbus:

Code: [Select]
wpa_supplicant-2.9/wpa_supplicant/dbus/fi.w1.wpa_supplicant1.service

[D-BUS Service]
Name=fi.w1.wpa_supplicant1
Exec=/usr/bin/wpa_supplicant -u
User=root
SystemdService=wpa_supplicant.service


wpa_supplicant-2.9/wpa_supplicant/systemd/wpa_supplicant.service

[Unit]
Description=WPA supplicant
Before=network.target
Wants=network.target

[Service]
Type=dbus
BusName=fi.w1.wpa_supplicant1
ExecStart=/usr/bin/wpa_supplicant -u

[Install]
WantedBy=multi-user.target
Alias=dbus-fi.w1.wpa_supplicant1.service

So you need the non-systemd Runit equivalent of that setup. Perhaps install (and set up if required) wpa_supplicant-runit ?
The dbus service file is already installed : /usr/share/dbus-1/system-services/fi.w1.wpa_supplicant1.service

 

Re: Small problem with wpa_supplicant

Reply #8
I think you hit the real problem there, it SHOULD be a service and communicate with NetworkManager through dbus:

Code: [Select]
wpa_supplicant-2.9/wpa_supplicant/dbus/fi.w1.wpa_supplicant1.service

[D-BUS Service]
Name=fi.w1.wpa_supplicant1
Exec=/usr/bin/wpa_supplicant -u
User=root
SystemdService=wpa_supplicant.service


wpa_supplicant-2.9/wpa_supplicant/systemd/wpa_supplicant.service

[Unit]
Description=WPA supplicant
Before=network.target
Wants=network.target

[Service]
Type=dbus
BusName=fi.w1.wpa_supplicant1
ExecStart=/usr/bin/wpa_supplicant -u

[Install]
WantedBy=multi-user.target
Alias=dbus-fi.w1.wpa_supplicant1.service

So you need the non-systemd Runit equivalent of that setup. Perhaps install (and set up if required) wpa_supplicant-runit ?
The dbus service file is already installed : /usr/share/dbus-1/system-services/fi.w1.wpa_supplicant1.service

I tried to set up wpa_supplicant-runit but it seems to ouput more now (including the help information repeatedly). It seems like the combination of NetworkManager and wpa_supplicant are broken in the artix repositories with runit.

I'll probably go with the NetworkManager / symlinked wpa_supplicant option for now, but I'm hoping that this will get figured out. It's a weird bug. If anyone is running NetworkManager with success without this problem I'd definitely like to know!