I have a running wpa_supplicant on Ubuntu 22.10 as also I can see when I run the commands:
$ systemctl list-unit-files --state=enabled
...
wpa_supplicant.service enabled enabled
...
$ systemctl status wpa_supplicant
wpa_supplicant.service - WPA supplicant
Loaded: loaded (/lib/systemd/system/wpa_supplicant.service; enabled; preset: enabled)
Active: active (running) since Thu 2022-11-03 05:32:41 GMT; 1h 14min ago
Main PID: 1159 (wpa_supplicant)
Tasks: 1 (limit: 38321)
Memory: 5.5M
CPU: 24ms
CGroup: /system.slice/wpa_supplicant.service
└─1159 /sbin/wpa_supplicant -u -s -O /run/wpa_supplicant
...
However when I switch off the machine I can see from the screen messages that it's trying to close down the wpa_supplicant job in a sort of loop forcing me to switch off the machine pressing manually. How can I fix that?
Ok I have found the reason and solution. I have removed the packages "tlp" and "tlp-rdw" which optimize the battery life on a laptop. On my Desktop machine I assume it is not needed so I safely removed them and now I can switch off the machine quickly. It was causing the hang chain: Network manager wait on -> wpa_supplicant wait on -> tlp. I saw this after I waited for over 20 mins until a log message related to tlp has been shown.