Re: system sleep -> nm reacts too fast



Hi Beniamino,

On Wed, Jul 13, 2016 at 06:41:00PM +0200, Michael Hirmke wrote:
I tried
- the systemd sleep scripts (/usr/lib/systemd/system-sleep)
- the NetworkManager dispatcher scripts
  (/etc/NetworkManager/dispatcher.d)

Did you use a 'pre-down' script (see 'man NetworkManager' for the
details)? That should work as NM waits that the script returns before
continuing and bringing down the interface. If you used a script on
the 'down' event, it's called too late when the interface is already
down.

yes, I tried that, too, but when going to sleep, NM doesn't seem to run
the dispatcher scripts at all.
But I should have been a bit more specific:
The problem occurs with a strongswan vpn connection.

From the journal:
------------------------< snip snip snip >-----------------------------
...
systemd-logind[754]: Power key pressed.
NetworkManager[762]: <info>  [1468426628.3819] manager: sleep requested (sleeping: no  enabled: yes)
NetworkManager[762]: <info>  [1468426628.3820] manager: sleeping...
NetworkManager[762]: <info>  [1468426628.3821] device (wlan0): state change: unavailable -> unmanaged (reason 
'sleeping') [20 10 37]
NetworkManager[762]: <info>  [1468426628.3831] device (ttyUSB0): state change: activated -> unmanaged (reason 
'sleeping') [100 10 37]
NetworkManager[762]: <info>  [1468426628.4001] dhcp4 (wwan0): canceled DHCP transaction, DHCP client pid 6899
NetworkManager[762]: <info>  [1468426628.4001] dhcp4 (wwan0): state changed bound -> done
charon-nm[2647]: 12[KNL] <wwa0 ip> disappeared from wwan0
charon-nm[2647]: 01[KNL] interface wwan0 deactivated
...
------------------------< snip snip snip >-----------------------------

So the underlying wwan connection is down, while the vpn connection
still tries to reach its partner.
And: There has been logged no attempt to run my dispatcher script.

Beniamino

Bye.
Michael.
-- 
Michael Hirmke


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]