You are not logged in.
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
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
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
Did you find an alternative in the end? Thanks in advance.
Offline
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
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
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
Thanks! You gave me an idea. It's ugly but it works.
Offline
In anybody has a decent workaround (better than manually umount the nfs share), that would be really appreciated!
Thanks
Offline
@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
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
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