dhcpcd-discuss

Re: Issues with suspend-to-ram (netctl)

Roy Marples

Sun Sep 06 02:50:42 2020

On 05/09/2020 17:21, Jouke Witteveen wrote:
I can replicate this on Devuan, thanks for the example.
My diagnosis is that ifplugd is crashing - the equivalent setup using netplug
rather than ifplugd works fine.

It looks more like stalling to me, but indeed, ifplugd seems to be
doing something weird.

The clue was that when dhcpcd forked, output still continued on stderr.
When this occurred, ifplugd did not log "Program success" because the ifplugd.action process (which calls and monitors the actual shell script) crashed which the master ifplugd process didn't pickup, thus though was still running - hence you think it's stalled.

The fix is to setup a sockpair, close stdout/stderr when doing the initial fork
and then send stderr via the socketpair which the launcher process can then send
to the real stderr.

What ifplugd is doing with stderr to cause this, I really don't know.

The fact that you figured this out so quickly is pretty amazing to me.
I'd be interested to read how you did it.

With something obscure like this I first needed a simple reproducer which you provided. Then it's just finding the last good working release and then bisecting the git changes until we find what caused this in the first place.
Once the cause was found it can then be fixed.

This is probably a cleaner way of doing things, but we have now lost all output
from dhcpcd-run-hooks from the initial start which I sometimes use to debug
with. I will work on that later, but now the master branch should be good for you.

Can you test it please?

Tested and the issue is gone! Impressive.

Excellent :)
I've comitted a subsequent patch to optimise it for a code reduction with comments.
script output is now emitted as well for a most excellent win :D

Please re-test to ensure it still works.

Roy

Follow-Ups:
Re: Issues with suspend-to-ram (netctl)Jouke Witteveen
References:
Issues with suspend-to-ram (netctl)Jouke Witteveen
Re: Issues with suspend-to-ram (netctl)Roy Marples
Re: Issues with suspend-to-ram (netctl)Neal P. Murphy
Re: Issues with suspend-to-ram (netctl)Jouke Witteveen
Re: Issues with suspend-to-ram (netctl)Roy Marples
Re: Issues with suspend-to-ram (netctl)Roy Marples
Re: Issues with suspend-to-ram (netctl)Roy Marples
Re: Issues with suspend-to-ram (netctl)Jouke Witteveen
Re: Issues with suspend-to-ram (netctl)Roy Marples
Re: Issues with suspend-to-ram (netctl)Jouke Witteveen
Re: Issues with suspend-to-ram (netctl)Roy Marples
Re: Issues with suspend-to-ram (netctl)Jouke Witteveen
Archive administrator: postmaster@marples.name