You are not logged in.

#1 2015-04-15 18:14:38

Soukyuu
Member
Registered: 2014-04-08
Posts: 854

NetworkManager-dispacther: pre-down actions no longer working

My experimental machine (see sig) has been using a pre-down script to unmount cifs shares before the WLAN connection goes down.
This has been working until I moved from KDE4+KDM to KDE5+SDDM. Now the pre-down action is only executed on logout, but not on restart/shutdown. This of course triggers the "unmounting <share>" message that hangs for 90 seconds.

The issue seems to be that NetworkManager-dispatcher.service does only execute the 'up' actions according the journal. When logging out before shutting down, 'pre-down' and 'down' are executed.
But shutting down directly skips both 'pre-down' and 'down' actions, as if the service is just killed.

I have tried downgrading NetworkManager and systemd to the versions present at the time I added the instructions above to the wiki, but that doesn't seem to change anything.
The only other variable that changed is SDDM and KDE5. I can rule out SDDM because the same issue happens with LXDM.
And the KDE devs seem to think KDE can't be causing that.
I'm out of ideas on how to get this working again.


[ Arch x86_64 | linux | Framework 13 | AMD Ryzen™ 5 7640U | 32GB RAM | KDE Plasma Wayland ]

Offline

#2 2015-04-17 07:42:08

Strike0
Member
From: Germany
Registered: 2011-09-05
Posts: 1,483

Re: NetworkManager-dispacther: pre-down actions no longer working

I can't tell you why the behaviour for pre-down changed on shutdown, but one suggestion separate from networkmanager: Have a look at

man systemd-inhibit

(easy example at the end). Maybe you could define an inhibit-lock for shutdown that executes something to unmount your cifs share before shutdown proceeds. Probably networkmanager should have defined such lock generally to execute required scripts, but has not (yet).

Offline

#3 2015-04-17 10:14:20

Soukyuu
Member
Registered: 2014-04-08
Posts: 854

Re: NetworkManager-dispacther: pre-down actions no longer working

Thanks, I'll look at that. I've found a bug report on the gnome bug tracker that has the same issue as I have, and apparently it was a change they intended to allow a "non-destructive" restart of network manager. So the 'pre-down' and 'down' actions are now only executed if you either manually disconnect from the network, or if the connection drops. That's a pretty big loss of functionality in exchange of an unlikely scenario if you ask me.


[ Arch x86_64 | linux | Framework 13 | AMD Ryzen™ 5 7640U | 32GB RAM | KDE Plasma Wayland ]

Offline

#4 2015-04-26 14:22:18

zorrivel
Member
Registered: 2014-04-02
Posts: 10

Re: NetworkManager-dispacther: pre-down actions no longer working

Did you find an alternative in the end? Thanks in advance.

Offline

#5 2015-04-26 14:33:03

Soukyuu
Member
Registered: 2014-04-08
Posts: 854

Re: NetworkManager-dispacther: pre-down actions no longer working

Yes - windows.

Seriously speaking, no. I've suggested they implement a delay lock using systemd's inhibit API and handle pre-down and down actions there, but so far there has been no reaction. If they ever change/implement it, it will be working again.
Installing an old version of NetworkManager does not work, it crashes on startup, probably because of some libs not being compatible anymore. Compiling from source using the ABS fails at testing stage and I cba to debug that - I have no knowledge about it.


[ Arch x86_64 | linux | Framework 13 | AMD Ryzen™ 5 7640U | 32GB RAM | KDE Plasma Wayland ]

Offline

#6 2015-04-26 16:07:17

zorrivel
Member
Registered: 2014-04-02
Posts: 10

Re: NetworkManager-dispacther: pre-down actions no longer working

Thanks Soukyuu. I find it bizarre that such basic functionality seems to be so difficult to put together. I was trying to go down the x-systemd.automount path, which has the same 1.5 min delay at shutdown/reboot, because in systemd remote-fs.target comes after networking. It seems fixable but that seems to involve getting your hands really dirty with systemd targets. After wasting 6 hours of a Sunday, I'm going to give up and crawl back to whatever manual solutions I had before.

edit: english

Last edited by zorrivel (2015-04-26 16:21:35)

Offline

#7 2015-04-26 16:39:54

Soukyuu
Member
Registered: 2014-04-08
Posts: 854

Re: NetworkManager-dispacther: pre-down actions no longer working

Well, you could see if your DE has any way of running shutdown scripts. I've been using those in KDE4 but it broke with plasma. Maybe other DEs have something similar.


[ Arch x86_64 | linux | Framework 13 | AMD Ryzen™ 5 7640U | 32GB RAM | KDE Plasma Wayland ]

Offline

#8 2015-04-26 21:07:01

zorrivel
Member
Registered: 2014-04-02
Posts: 10

Re: NetworkManager-dispacther: pre-down actions no longer working

Thanks! You gave me an idea. It's ugly but it works.

Offline

#9 2015-04-29 11:45:17

Guidobelix
Member
From: Italy
Registered: 2013-06-21
Posts: 31

Re: NetworkManager-dispacther: pre-down actions no longer working

In anybody has a decent workaround (better than manually umount the nfs share), that would be really appreciated!

Thanks smile

Offline

#10 2015-04-29 11:55:15

Soukyuu
Member
Registered: 2014-04-08
Posts: 854

Re: NetworkManager-dispacther: pre-down actions no longer working

@zorrivel: please post your ugly idea, better than having nothing.


[ Arch x86_64 | linux | Framework 13 | AMD Ryzen™ 5 7640U | 32GB RAM | KDE Plasma Wayland ]

Offline

#11 2015-04-30 15:02:04

zorrivel
Member
Registered: 2014-04-02
Posts: 10

Re: NetworkManager-dispacther: pre-down actions no longer working

Sure. I don't currently use desktop environments - just i3. It's very flexible and it's common to have keybindings configured to logout, suspend, reboot, etc. I'm still using the NM dispatcher as usual. Additionally, I did a shell script called  umount-cifs that unmounts my smb shares. So now instead of having keybindings that point to, i.e. 'systemctl reboot', I now have 'umount-cifs && systemctl reboot'. It's not ideal and you have to make sure you always use this method. If X crashes and you shutdown, for example, it obviously won't work. In my opinion the most elegant way of doing this should be via x-systemd.automount, but it has the same problem as the NM dispatcher.

Offline

#12 2015-06-01 12:37:55

bdika
Member
Registered: 2008-10-04
Posts: 9

Re: NetworkManager-dispacther: pre-down actions no longer working

Could someone please give me a hint in how to implement zorrivel's or any other solution in Plasma 5 desktop with SDDM.

Thanks in advance.

bdika

Last edited by bdika (2015-06-01 12:44:06)

Offline

Board footer

Powered by FluxBB