summaryrefslogtreecommitdiff
path: root/nslcd/daemonize.c
AgeCommit message (Collapse)Author
2014-09-28Turn into a new-style systemd daemonLuke Shumaker
2014-05-04Log daemonising failuresArthur de Jong
This also clears errno in the main function to ensure that no incorrect errno value is logged on errors.
2014-01-02Close daemon pipe file descriptor on fork or execArthur de Jong
This tries to avoid child processes ending up with a copy of the pipe file descriptor that is used to signal readiness of the daemon.
2014-01-02Properly daemonise nslcd and only exit when readyArthur de Jong
This introduces a new daemonize module that provides functions for closing all file descriptors, redirecting stdin/stdout/stderr to /dev/null and a function for backgrounding an application while only exiting the original process after the daemon process has indicated readiness. This is used to exit the original process only after the listening socket has been set up and the worker threads have been started.