Re: Issues with suspend-to-ram (netctl)
Jouke Witteveen
Sun Sep 06 06:48:01 2020
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.
Unfortunately, I'm gone for the rest of today, so I can't run any
further tests until tonight.
Regards,
- Jouke
Archive administrator: postmaster@marples.name