I need to run
sudo killall wpa_supplicant
automatically after resume. Unfortunately on 15.04 with systemd it isn't possible with scripts.
How this may be automated?
You need to place your scripts in:
/lib/systemd/system-sleep/
An example script based on one from the Arch wiki (systemd sleep Hooks):
#!/bin/sh
case $1/$2 in
pre/*)
echo "Going to $2..."
# better to put `exit 0` if no pre suspend action required
;;
post/*)
echo "Waking up from $2..."
# Add whatever you want run post suspend (ie resume)
killall wpa_supplicant
;;
esac
Dont forget to make your script executable!
sudo chmod a+x /lib/systemd/system-sleep/your-script
See man systemd-sleep
for more details.
There is no need for sudo
as your script will be run as root.
sudo killall wpa_supplicant
manually from command line still helps.
May 7, 2015 at 13:47
ps aux > /tmp/testps
or something after echo "waking...
to see if wpa_supplicant is running. Maybe you need to sleep for a few seconds first, start high adding sleep 10s
before killall wpasupplicant
.
sleep 10s
is a good idea. I am trying it now. Thanks!
May 12, 2015 at 11:38