2

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:

[Unit]
Description=Starts WLAN configurations (customized)
Wants=network.target
After=network.target

[Service]
Type=simple
ExecStart=/usr/sbin/startuphelper.sh
TimeoutStartSec=15s

[Install]
WantedBy=default.target

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 [email protected]" 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.

6
  • 1
    Why don't you configure and use the existing wpa_supplicant.service? Commented Apr 18, 2019 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). Commented Apr 18, 2019 at 5:03
  • 1
    Nope, it just runs wpa_supplicant with whatever options you provided. It's entirely independent of NetworkMangler. Commented Apr 18, 2019 at 5:30
  • I think I tried it earlier, but I'll try it again and post those results. Commented Apr 18, 2019 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
    Commented Apr 18, 2019 at 6:59

1 Answer 1

0

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .