antirez/redis — pull request #1317 by stevestavropoulos (2013-10-12 18:20:16+00:00)
Title: Close all FDs inherited from previous processes when forking to enter daemon mode

When redis is started from php/apache it inherits all open file descriptors of apache/php, which creates a problem when stopping apache - the FDs, including connections to apache ports (80, 443,...), remain in use by redis and apache can't get restarted without stopping redis.
This patch closes all open file descriptors inherited from any process when going into daemon mode.