dhcpcd-discuss

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

Jouke Witteveen

Sun Sep 06 06:52:52 2020

On Sun, Sep 6, 2020 at 7:47 AM Jouke Witteveen <j.witteveen@xxxxxxxxx> wrote:
>
> On Sun, Sep 6, 2020 at 3:50 AM Roy Marples <roy@xxxxxxxxxxxx> wrote:
> >
> > 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.
>
> The current code no longer works and produces
>
> # /usr/bin/ifplugd -i eth0 -r /tmp/ifplugd.action -ns
> ifplugd 0.28 initializing.
> Using interface eth0/[...] with driver <e1000e> (version: 3.2.6-k)
> Using detection mode: SIOCETHTOOL
> Initialization complete, link beat detected.
> Executing '/tmp/ifplugd.action eth0 up'.
> Program execution failed, return value is 1.
> Exiting.
>

Sorry about this, it works just fine! I simply forgot to add the
modeline to the action script.

Hooray!
- Jouke

Follow-Ups:
Re: Issues with suspend-to-ram (netctl)Roy Marples
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
Re: Issues with suspend-to-ram (netctl)Roy Marples
Re: Issues with suspend-to-ram (netctl)Jouke Witteveen
Archive administrator: postmaster@marples.name