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 firstname.lastname@example.org" 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.