[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: rpm leaks an fd in install/erase scripts



jbj@redhat.com (Jeff Johnson) writes:

>> > You are correct, sshd (and all processes claiming to be daemons)
>> > should run through open fd's and close them.
>> 
>> True for fd 0-2, but should not be done generally. E.g. djb's fghack
>> from his daemontools will not work when sshd closes all descriptors.
>
> Hmmm, I seem to see the letter h-a-c-k there, but mebbe it's just me.

Yes; it is a hack to deal with daemons which do not support modern
init-concepts. See http://cr.yp.to/daemontools/faq/create.html#fghack

There are other approaches (e.g. Felix von Leitner's 'pidfilehack')
which are using the information from /var/run/sshd.pid to attach the
sshd-daemon to init; but they are consisting of the letters h-a-c-k
also.


>> (ok; the right way would be to convince sshd people to add a
>> '--operate-normally-but-do-not-go-into-background' option).
>
> Now you're starting to make sense.  Might even be there, -d for daemons
> often avoids the fork/daemonize which is painful to debug.

Indeed, sshd does not go into background when using it. Unfortunately,
'-d' means 'debug' which can have negative sideeffects (e.g. cluttering
output, superfluous sanity checks for internal operations).



Enrico




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] []