NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: misc/49738 rc.subr leaks filedescriptors

    Date:        Thu, 20 Oct 2016 11:02:12 -0400
    From: (Christos Zoulas)
    Message-ID:  <>

  | How about:
  | and adding:
  | cloexec +7 +8 in /etc/rc?

It would want to include fd 9 as well ... but at the expense of adding
more non-standard baggage to NetBSD's sh, and having the rc system not
workable on any other sh, then that would work.

I believe that mostly the rc system correctly closed the fd's it opens
(which is the standard way to handle this) - but that this fails when the
rc.d/script has its oeb start function (as for example, lvm does) which
knows nothing about needing to close rc maintained (they are not from rc.subr
the Subject of this PR is incorrect) file descriptors.

An alternative would be to add a new function to the rc system for scripts
to call, to close any fd's that the rc system has opened, and then have
the relevant scripts call that function - it could be made reasonably general
to allow for other similar future issues, perhaps "rc_exec_cleanup" or


Home | Main Index | Thread Index | Old Index