Homec4science

Make bin/aphlict behave slightly better when forking

Authored by Nick Harper <nharper@fb.com> on Dec 20 2012, 19:38.

Description

Make bin/aphlict behave slightly better when forking

Summary:
Due to how file descriptors get inherited when a process forks and the way
our script to start/restart stuff works, having bin/aphlict not close
STDOUT caused our script to hang. This diff provides a solution; however,
something like https://secure.phabricator.com/diffusion/PHU/browse/master/src/daemon/PhutilDaemonOverseer.php;b45eea975f6d9afc$127-129
may be better or more robust.

Test Plan:
Run our script that calls bin/aphlict in passthru() and see that it no
longer hangs.

Reviewers: epriestley, vrana

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4240

Details

Committed
Nick Harper <nharper@fb.com>Dec 20 2012, 19:38
Pushed
aubortJan 31 2017, 17:16
Parents
rPH776a240870f3: Let Aphlict listen on the specified host
Branches
Unknown
Tags
Unknown

Event Timeline

Nick Harper <nharper@fb.com> committed rPH53115007ff84: Make bin/aphlict behave slightly better when forking (authored by Nick Harper <nharper@fb.com>).Dec 20 2012, 19:38