sapling/eden/fs
Matt Glazar 13d7be97ea Fix stdin fd leak in daemon mode
Summary:
When running edenfs in daemonize mode (i.e. when --foreground is not specified), the daemon process inherits stdin from the parent and never closes it. This has two consequences:

* The daemon process holds a reference to stdin even after the parent exits. This causes tests to hang if they wait for EPIPE on stdin after waiting for the parent process to exit. (I discovered this issue when adding tests for 'eden start' in D10434379.)
* edenfs could potentially read from the terminal after 'eden start' has returned. I think this behavior is surprising and could potentially cause problems.

Promptly close stdin after forking the daemon process, since nothing inside the daemon needs stdin.

Reviewed By: simpkins

Differential Revision: D10442346

fbshipit-source-id: f3d287e8b48e121807f845b73a1a550e63efae25
2018-10-25 12:54:42 -07:00
..
config folly::Optional -> std::optional 2018-10-23 17:05:11 -07:00
fuse folly::Optional -> std::optional 2018-10-23 18:51:59 -07:00
inodes folly::Optional -> std::optional 2018-10-23 18:51:59 -07:00
journal explicitly complete StreamPublisher stream on destruct 2018-10-01 13:21:59 -07:00
model folly::Optional -> std::optional 2018-10-23 18:51:59 -07:00
rocksdb add CMake build files 2018-04-30 14:37:46 -07:00
service Fix stdin fd leak in daemon mode 2018-10-25 12:54:42 -07:00
sqlite avoid leaking the sqlite3 db if we fail to open it 2018-06-20 16:36:22 -07:00
store add option and disable datapack getBlob implementation 2018-10-24 10:47:59 -07:00
takeover folly::Optional -> std::optional 2018-10-23 18:51:59 -07:00
testharness folly::Optional -> std::optional 2018-10-23 18:51:59 -07:00
utils folly::Optional -> std::optional 2018-10-23 18:51:59 -07:00
CMakeLists.txt add CMake build files 2018-04-30 14:37:46 -07:00