F-Ticks logging changes
[radsecproxy.git] / radsecproxy.c
index 6554e8d..426b65b 100644 (file)
@@ -1668,7 +1668,7 @@ void replyh(struct server *server, unsigned char *buf) {
     }
 
 #if defined(WANT_FTICKS)
-    if (msg->code == RAD_Access_Accept || msg->code == RAD_Access_Reject)
+    if (msg->code == RAD_Access_Accept || msg->code == RAD_Access_Reject) 
        if (options.fticks_reporting && from->conf->fticks_viscountry != NULL)
            fticks_log(&options, from, msg, rqout);
 #endif
@@ -2273,8 +2273,14 @@ int dynamicconfig(struct server *server) {
     }
 
     if (status) {
-       debug(DBG_INFO, "dynamicconfig: command exited with status %d", WEXITSTATUS(status));
-       goto errexit;
+       if (WEXITSTATUS(status) == 10) {
+           debug(DBG_INFO, "dynamicconfig: command signals empty config");
+       }
+       else {
+           debug(DBG_INFO, "dynamicconfig: command exited with status %d",
+                 WEXITSTATUS(status));
+           goto errexit;
+       }
     }
 
     if (ok)
@@ -3076,6 +3082,7 @@ void getmainconfig(const char *configfile) {
 #endif
            "Rewrite", CONF_CBK, confrewrite_cb, NULL,
 #if defined(WANT_FTICKS)
+           "FTicksSyslogFacility", CONF_STR, &options.ftickssyslogfacility, 
            "FTicksReporting", CONF_STR, &fticks_reporting_str,
            "FTicksMAC", CONF_STR, &fticks_mac_str,
            "FTicksKey", CONF_STR, &fticks_key_str,
@@ -3233,8 +3240,15 @@ int radsecproxy_main(int argc, char **argv) {
        options.loglevel = loglevel;
     else if (options.loglevel)
        debug_set_level(options.loglevel);
-    if (!foreground)
-       debug_set_destination(options.logdestination ? options.logdestination : "x-syslog:///");
+    if (!foreground) {
+       debug_set_destination(options.logdestination ? options.logdestination : "x-syslog:///", DEBUG_LOG);
+#if defined(WANT_FTICKS)
+       if (options.ftickssyslogfacility) {
+               debug_set_destination(options.ftickssyslogfacility, FTICKS_LOG);
+               free(options.ftickssyslogfacility);
+       } 
+#endif
+    }
     free(options.logdestination);
 
     if (!list_first(clconfs))