:: Re: [DNG] Shutdown/halt versus WiFi…
Góra strony
Delete this message
Reply to this message
Autor: dng@d404.nl
Data:  
Dla: dng
Temat: Re: [DNG] Shutdown/halt versus WiFi and NFS
On 28-05-2022 17:10, Brad Campbell via Dng wrote:
> On 28/5/22 18:44, dng@??? wrote:
>> On 28-05-2022 10:23, Brad Campbell via Dng wrote:
>>> On 24/9/20 03:55, Michael S. Keller via Dng wrote:
>>>> My desktop is running Chimaera, and I saw this with Beowulf, but didn't spend much time on it then.
>>>>
>>>> My network connection is via WiFi, and I have permanent NFS mounts in place. I run SysV init.
>>>>
>>>> During halt or shutdown via init scripts, NetworkManager is terminated before the NFS unmount, which brings down the active NIC, and usually the unmount hangs forever, so I have to do a hard reset or power-off.
>>>>
>>>> After futzing with it for a while, trying to find a more elegant solution, I ended up just renaming K01network-manager and K02sendsigs in rc0.d and rc6.d. Now shutdown and reboot run reliably.
>>>>
>>>> Before that, I tried renaming K01network-manager to K06network-manager, to place it after the NFS unmount, but it ran earlier anyway.
>>>>
>>>> I also tried shielding NetworkManager from sendsigs, and I think it would have worked if I could make K0.network-manager run later, but that was about the point I gave up and took a virtual hammer to the issue.
>>> 2 years on and I keep bumping up against this issue on my laptop. Truth be told I've been bumping up against it for a long while, but an enforced break saw me have time to look into it.
>>>
>>> I've tried shuffling dependencies in the scripts, but can't seem to sort it out.
>>>
>>> Mine are transient nfs mounts, but if I forget to unmount one before rebooting it hangs and has to be power cycled.
>>>
>>> $ cat /etc/devuan_version
>>> chimaera
>>>
>>> Love to hear any suggestions.
>>>
>>> Regards,
>>> Brad
>>> _______________________________________________
>>> Dng mailing list
>>> Dng@???
>>> https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng
>> For my Raspberry Pi's to boot from nfs and to shutdown normally I had to add the variable
>>
>> persistent
>>
>> to /etc/dhcpcd.conf.
>>
>> Hope this helps.
>>
> Thanks Nick,
>
> Yes, I saw your response back in 2020.
>
> I've been trying to figure out how that applies to network manager, or how I could make a similar outcome.
> The problem here is network-manager gets killed early in the process. Same result but a different cause.
>
> Regards,
> Brad


Hi Brad,

I already thought to have seen the question before. Too bad it does not
work for you.

But maybe I have another solution. I am using chrony and this uses a
small script in /etc/NetworkManager/dispatcher.d named 20-chrony and
this content;

> #!/bin/sh
> # This is a NetworkManager dispatcher / networkd-dispatcher script for
> # chronyd to set its NTP sources online or offline when a network
> interface
> # is configured or removed
>
> export LC_ALL=C
>
> # For NetworkManager consider only up/down events
> [ $# -ge 2 ] && [ "$2" != "up" ] && [ "$2" != "down" ] && exit 0
>
> # Note: for networkd-dispatcher routable.d ~= on and off.d ~= off
>
> chronyc onoffline > /dev/null 2>&1
>
> exit 0


So maybe you can make a small nfs shutdown script and put it in
/etc/NetworkManager/dispatcher.d too or make a link to
/etc/init.d/umountnfs.sh?

Grtz.

Nick