[opensuse-factory] Tumbleweed: NetworkManager does not run script on shutdown
Dear list readers, I frequently work with servers and before i cut my network connection i like to do certain server related tasks. Most of the time i do that manually before i close my network connection or shutdown my workstation. But in order to make sure that important tasks will be done even if i forget about them i wrote a script and put it in /etc/NetworkManager/dispatcher.d/pre-down.d. The script logs its start and all its actions to the journal. When i close a network connection manually (with plasma5-nm) the script is called, does all what it is supposed to do and then the network connection is closed. However on shutdown that script gets never called. "man NetworkManager" says "pre-down The interface will be deactivated but has not yet been disconnected from the network. Scripts acting on this event must be placed or symlinked into the /etc/NetworkManager/dispatcher.d/pre-down.d directory, and NetworkManager will wait for script execution to complete before disconnecting the interface from its network. Note that this event is not emitted for forced disconnections, like when carrier is lost or a wireless signal fades. It is only emitted when there is an opportunity to cleanly handle a network disconnection event." That is close to the current description in https://developer.gnome.org/NetworkManager/stable/NetworkManager.html I consider "shutdown" not to be the sort of "forced disconnection" mentioned in those manuals and therefore think the script should be called. Searching the internet i found this https://bugzilla.gnome.org/show_bug.cgi?id=701242 but that is quite old (2013 - 2017) and this https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues?utf8=%E2... also some months without any reply. So now i'm quite confused: Is NetworkManager still supposed to call scripts in /etc/NetworkManager/dispatcher.d/pre-down.d even on system shutdown or not? Please could someone enlighten me? Thank you. My system runs openSUSE Tumbleweed 20191023 but the described behavior is the same on openSUSE Leap 15.0 and 15.1. Regards Hagen PS - I believe to vaguely recall that the script used to be called even on shutdown last year (openSUSE Leap 42.x). - I know that i probably could write a systemd-service to handle the shutdown-case. But before i look into this i want to be sure that NetworkManager will not handle it any more. -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
Hi, This is a question that would be better asked on the opensuse-support mailing list (cc'd) This list is for discussing project wide development of openSUSE rather then issues when using it. Thanks Simon On 10/27/19 1:48 AM, Hagen Buliwyf wrote:
Dear list readers,
I frequently work with servers and before i cut my network connection i like to do certain server related tasks. Most of the time i do that manually before i close my network connection or shutdown my workstation.
But in order to make sure that important tasks will be done even if i forget about them i wrote a script and put it in /etc/NetworkManager/dispatcher.d/pre-down.d. The script logs its start and all its actions to the journal.
When i close a network connection manually (with plasma5-nm) the script is called, does all what it is supposed to do and then the network connection is closed.
However on shutdown that script gets never called.
"man NetworkManager" says
"pre-down The interface will be deactivated but has not yet been disconnected from the network. Scripts acting on this event must be placed or symlinked into the /etc/NetworkManager/dispatcher.d/pre-down.d directory, and NetworkManager will wait for script execution to complete before disconnecting the interface from its network. Note that this event is not emitted for forced disconnections, like when carrier is lost or a wireless signal fades. It is only emitted when there is an opportunity to cleanly handle a network disconnection event."
That is close to the current description in
https://developer.gnome.org/NetworkManager/stable/NetworkManager.html
I consider "shutdown" not to be the sort of "forced disconnection" mentioned in those manuals and therefore think the script should be called.
Searching the internet i found this
https://bugzilla.gnome.org/show_bug.cgi?id=701242
but that is quite old (2013 - 2017) and this
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues?utf8=%E2...
also some months without any reply.
So now i'm quite confused:
Is NetworkManager still supposed to call scripts in /etc/NetworkManager/dispatcher.d/pre-down.d even on system shutdown or not?
Please could someone enlighten me?
Thank you.
My system runs openSUSE Tumbleweed 20191023 but the described behavior is the same on openSUSE Leap 15.0 and 15.1.
Regards
Hagen
PS - I believe to vaguely recall that the script used to be called even on shutdown last year (openSUSE Leap 42.x).
- I know that i probably could write a systemd-service to handle the shutdown-case. But before i look into this i want to be sure that NetworkManager will not handle it any more.
-- Simon Lees (Simotek) http://simotek.net Emergency Update Team keybase.io/simotek SUSE Linux Adelaide Australia, UTC+10:30 GPG Fingerprint: 5B87 DB9D 88DC F606 E489 CEC5 0922 C246 02F0 014B
participants (2)
-
Hagen Buliwyf
-
Simon Lees