"does it show up in any of the /var/log/pm-suspend.log logs."
gah, didn't have my admin hat fully in place... It is in the log. Anyway, with all that:
I rejigged the script:
Code: Select all
#!/bin/bash
PATH=/sbin:/usr/sbin:/bin:/usr/bin
case "$1" in
thaw|resume)
date >> /tmp/sleeper
echo "in resume selection" >> /tmp/sleeper
sleep 10
service network-manager restart >> /tmp/sleeper 2>&1
ip address show dev wlan0 >> /tmp/sleeper
date >> /tmp/sleeper
;;
esac
date >> /tmp/sleeper
echo "now outside case block" >> /tmp/sleeper
sleep 10
ip address show dev wlan0 >> /tmp/sleeper
date >> /tmp/sleeper
Rebooted, then tested by closing lid and leaving it closed for 5 mins. It did run, I've posted the pm-suspend.log snippet below. /tmp/sleeper is there, here's the output:
Wed Jan 24 10:38:52 ACDT 2024
now outside case block
2: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
link/ether d8:c0:a6:bf:55:03 brd ff:ff:ff:ff:ff:ff
Wed Jan 24 10:39:02 ACDT 2024
Wed Jan 24 10:39:17 ACDT 2024
in resume selection
Stopping network connection manager: NetworkManager.
Starting network connection manager: NetworkManager.
2: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
link/ether d8:c0:a6:bf:55:03 brd ff:ff:ff:ff:ff:ff
Wed Jan 24 10:39:27 ACDT 2024
Wed Jan 24 10:39:27 ACDT 2024
now outside case block
2: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether d8:c0:a6:bf:55:03 brd ff:ff:ff:ff:ff:ff
inet 192.168.0.102/24 brd 192.168.0.255 scope global dynamic noprefixroute wlan0
valid_lft 86395sec preferred_lft 86395sec
inet6 fe80::9537:48bb:f497:378/64 scope link noprefixroute
valid_lft forever preferred_lft forever
Wed Jan 24 10:39:37 ACDT 2024
So it ran twice, somehow. After all that, a few seconds later a message window from network manager pops up: 'Connection WirelessSSID deactivated'. So we are barking up the wrong tree, the deactivation occurs after the hibernation restoration, presumably by NM based on the message.
In syslog, I see (in snips):
Code: Select all
2024-01-24T10:39:17.303331+10:30 phil-envy kernel: [ 65.576699] PM: hibernation: hibernation exit
2024-01-24T10:39:31.819179+10:30 phil-envy kernel: [ 80.096338] wlan0: authenticated
2024-01-24T10:39:31.883266+10:30 phil-envy wpa_supplicant[2460]: wlan0: CTRL-EVENT-CONNECTED - Connection to 5c:a6:e6:55:27:e5 completed [id=0 id_str=]
2024-01-24T10:40:37.587144+10:30 phil-envy kernel: [ 145.862843] wlan0: deauthenticating from 5c:a6:e6:55:27:e5 by local choice (Reason: 3=DEAUTH_LEAVING)
2024-01-24T10:40:37.612366+10:30 phil-envy wpa_supplicant[2460]: wlan0: CTRL-EVENT-DISCONNECTED bssid=5c:a6:e6:55:27:e5 reason=3 locally_generated=1
So, where to from here?