Ensure socket connections are closed after exec
Ensure socket connections are closed after exec

This sets the FD_CLOEXEC file descriptor on each server connection.
This causes the socket connection to be automatically closed if
the server uses any of the exec functions.

Normally when forking a process, the new process receives a copy of all
open file descriptors.  If a bluepill command (such as restart) executes
a system call that forks and runs for a long time, the bluepill client
connection remains open in the forked process even after the bluepill
server closes the connection.  This causes the bluepill client's
socket.read call to block forever, eventually timing out and raising a
"Socket Timeout: Server may not be responding" error.

Setting close_on_exec causes new processes to automatically close the
socket connection, thus preventing this error.

fgbreel/bluepill,sferik/bluepill,iroller/bluepill,dealpath/bluepill,d-unseductable/bluepill,iroller/bluepill,d-unseductable/bluepill,bluepill-rb/bluepill,fgbreel/bluepill,bluepill-rb/bluepill,dealpath/bluepill,sferik/bluepill