Handle syslog, too
authorAlan T. DeKok <aland@freeradius.org>
Fri, 4 Apr 2014 15:10:06 +0000 (11:10 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 4 Apr 2014 15:10:06 +0000 (11:10 -0400)
src/main/radiusd.c

index 85dfaad..d8ad145 100644 (file)
@@ -407,6 +407,15 @@ int main(int argc, char *argv[])
                        dup2(devnull, STDOUT_FILENO);
                }
 
+       } else if (mainconfig.radlog_dest == RADLOG_SYSLOG) {
+               /*
+                *      Discard STDOUT and STDERR no matter what the
+                *      status of debugging.  Syslog isn't a file
+                *      descriptor, so we can't use it.
+                */
+               dup2(devnull, STDOUT_FILENO);
+               dup2(devnull, STDERR_FILENO);
+
        } else if (debug_flag) {
                /*
                 *      If we're debugging, allow STDOUT and STDERR to