Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MINOR: startup: close devnullfd, when daemon mode is applied
In case of daemon mode now daemonization fork happens in the early init stage before parsing and applying the configuration, so we can't close stdio/stderr/stdout immediately after forking. We keep it open until the most of configuration, including chroot are applied in order to show alerts, if there are some problems. To achieve this /dev/null is opened just before calling chroot(), and after the chroot block it's used to close all standard outputs and stdin. At this point we no longer need the fd of /dev/null, so we can close it as well.
- Loading branch information