I've written a script to manually start the wpa_supplicant function on a Fedora/Centos7 machine with a wireless NIC. Due to static routing issues, I cannot use NetworkManager (nor do I want do with any type of work-arounds due to previous complications).

When I run wpa_supplicant -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf -B dhclient wlan0 from the CLI everything runs just fine. I then run dhclient wlan0 to get an IP and everything connects.

I've put the same exact command in a script, named "startuphelper.sh" in /usr/sbin/ - and then written a systemd service:

Description=Starts WLAN configurations (customized)



I've enabled this service (systemctl enable wlanhelp.service) - and it runs successfully, but does not actually start an wpa_supplicant instance (pidof wpa_supplicant yields nothing).

What am I missing?

EDIT1: reference the first comment, I did try using the pre-installed wpa_supplicant service, but that didn't seem to auto-connect on boot, either.

EDIT2: So I've obviously self-inflicted this problem, but when I enable the built-in wpa_supplicant service, it doesn't seem to like ssh logins from remote sessions. It just hangs and hangs on the "ssh root@" on the client I'm trying to use to access the server. If I go into the machine from the console, and try to run much of anything, it just hangs.

SOLVED: Edit: So I didn't realize the built-in supplicant service needed the -i specified. Appears to be working now.

  • 1
    Why don't you configure and use the existing wpa_supplicant.service? – Michael Hampton Apr 18 '19 at 3:56
  • I was under the impression that required NM to be running and managing the if, is that incorrect? (either way, that didn't work either, so I guess the question still stands, but i'll update the OP to reflect). – customcables067 Apr 18 '19 at 5:03
  • 1
    Nope, it just runs wpa_supplicant with whatever options you provided. It's entirely independent of NetworkMangler. – Michael Hampton Apr 18 '19 at 5:30
  • I think I tried it earlier, but I'll try it again and post those results. – customcables067 Apr 18 '19 at 5:36
  • 1
    Instead of answering the question in the question itself, please write an answer (and accept it). That will help anyone else with the same or a similar problem to find the answer. – dirkt Apr 18 '19 at 6:59

Ended up being a self-inflicted problem. Used the built-in wpa_supplicant service which didn't initially work, but I wasn't specifying the -i command in the actual service config file. I will update at a later time as to why my custom script did not work once I have more time to t-shoot.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for?Browse other questions tagged or ask your own question.