Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/nslcd/daemonize.c
Commit message (Collapse)AuthorAgeFilesLines
* ENODATA is missing on FreeBSDArthur de Jong2015-03-221-1/+5
| | | | FreeBSD doesn't have ENODATA so we use ENOATTR instead.
* Fix issues with daemonisingArthur de Jong2014-09-281-14/+24
| | | | | | | | This fixes a problem with a buffer that could end up padded with garbage. This also clarifies the code a bit and adds extra logging for errors that could occur during daemonising.
* Log daemonising failuresArthur de Jong2014-05-041-0/+12
| | | | | This also clears errno in the main function to ensure that no incorrect errno value is logged on errors.
* Close daemon pipe file descriptor on fork or execArthur de Jong2014-01-021-0/+18
| | | | | 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.
* Properly daemonise nslcd and only exit when readyArthur de Jong2014-01-021-0/+191
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.