[lug] socket programming/kernel question

Bear Giles bgiles at coyotesong.com
Wed Mar 5 16:08:26 MST 2003


Zan Lynx wrote:
> The server gets a shutdown request or a signal (You _can_ catch SIGBUS,
> SIGILL, and SIGSEGV for this) and execs a process that will hold state
> for it.  This includes the still open sockets.  Then, when this tiny
> state-holder process gets a signal, like SIGUSR1, it execs the original
> again, with flags to tell it to resume state.  It can use a connection
> log file or a bit of shared memory to figure out what file descriptors
> point where.

That still gives you zombies.

But a variant is to use a Unix socket to pass a SCM_RIGHTS (iirc) 
message with all of the open sockets.  This "has the same effect 
as calling dup()".  The original program dies outright, it's 
restarted, and it gets its sockets back via the same mechanism.






More information about the LUG mailing list