Re: Socket inheritance: A tale of two vendors



Chris Friesen wrote:
> If the problem is the socket inheritance, one possible workaround would
> be to rename the daemon (we'll call it "daemon.orig"), then create a new
> app called "daemon" that simply closes all open sockets other than 0/1/2
> and then exec()'s "daemon.orig" with the same parameters with which it
> itself was called.

Thank you for your thoughts, Chris. The idea of a wrapper wasn't one
I'd considered while pondering workarounds.

The far simpler workaround is to make darn sure that "daemon" is
running all the time, so that it's client application doesn't have to
fire it up. In that case, sockets never get inherited and the whole
exercise is moot.

At this point, I'm looking to get the software fixed, not for
workarounds, and the next bit of your post offers a hint of what I was
looking for:

> Something else to consider--if they've messed this up, they might have
> screwed up other stuff too. You might also want to reset signal
> handlers and clear the signal mask before doing the exec().

Now this part of your post is very useful to me!

Apparently the procedures in UNP regarding closing everything, signal
handlers, signal mask, process groups, etc is standard practice?

Daemons that don't do this are "messed up"?

The bind I'm in is: Which vendor should I go harass about the problem?

Vendor A for the application's failure to set close-on-exec on his
sockets
-- or --
Vendor B for the daemon's failure to close sockets it doesn't need

You're steering me toward vendor B.

/chris marget

.



Relevant Pages

  • Re: Jail to jail network performance?
    ... > Ideally I would like a daemon like socat that can connect/merge two ... > sockets into one, effectively creating a direct connection and ... was able to access both file systems should be able to do a handoff. ...
    (freebsd-stable)
  • Re: passing data to a daemon
    ... > so that the daemon is always running, where its running consists of ... > describes writing a daemon in Python. ... how will I submit jobs to the queue? ... Sockets another. ...
    (comp.lang.python)
  • Re: Multicast Registrierung schlaegt fehl
    ... Allerdings kann's der andere Daemon mit der gleichen lib ja auch... ... der betreffende Part vom oeffnen des Sockets bis zur Registrierung ist hier: ...
    (de.comp.os.unix.programming)
  • Re: unix domain sockets vs. internet sockets
    ... Could you compare ip sockets and unix domain sockets? ... > criterions are performance and protocol load. ... If you *don't want* remote processes access to your daemon, ...
    (freebsd-performance)
  • Re: Preventing URLConnection from buffering entire output stream
    ... > clone based on Sockets? ... Calling flush() on the OutputStream ... > I understand that a workaround would be to use the new features ...
    (comp.lang.java.programmer)