Page MenuHomeFreeBSD

rtsold: ignore SIGCHLD to reap the casper daemon
Needs ReviewPublic

Authored by bapt on Wed, Sep 2, 4:09 PM.

Details

Reviewers
markj
kib
Summary

rtsold closes the casper channel after opening its services; the
kernel then kills the casper daemon with SIGKILL when the last
process descriptor is closed. As rtsold never waits for children,
the casper daemon lingers as a zombie for the process lifetime.

Commit bcdb6ba94d08 stopped unconditionally reparenting a pdfork(2)
child to init(8) when its last process descriptor is closed: the
parent is now expected to wait(2) or ignore SIGCHLD.

Ignore SIGCHLD so the kernel reaps exited children automatically.
Scripts are run by the rtsold.script service, so script status
handling is unaffected.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 76406
Build 73289: arc lint + arc unit

Event Timeline

bapt requested review of this revision.Wed, Sep 2, 4:09 PM

I am really not confident about this one, I tried to put all my understanding of the situation in the commit log, so reviewer can see what I understood

This is reproducible with rtsold -a -i with any kernel from after july I have not bissect to confirm 100% it appeared since @kib commit. bug adding this change fixes the issue here I don't see any zombie left.

Are you stating that libcapser does not waitpid() on the resulting pid after pdfork()? If yes, the proper solution is to add PD_NOWAITPID to pdfork() call. This should fix it for all consumers.