More logging in the event of startup failures.
Kevin Webb [Wed, 19 Nov 2008 06:43:42 +0000 (06:43 +0000)]
drl/ulogd_DRL.c

index b87b96e..e8e0747 100644 (file)
@@ -1279,6 +1279,8 @@ static int init_drl(void) {
 
     if (parse_drl_config(drl_configfile.u.string, &configs)) {
         /* Parse error occured. Return non-zero to notify init_drl(). */
+        printlog(LOG_CRITICAL, "Failed to parse the DRL configuration file (%s).\n",
+            drl_configfile.u.string);
         return false;
     }
 
@@ -1286,11 +1288,14 @@ static int init_drl(void) {
     if (validate_configs(configs, &limiter.stable_instance)) {
         /* Clean up everything. */
         free_failed_config(configs, &limiter.stable_instance);
+        printlog(LOG_CRITICAL, "Invalid DRL configuration file (%s).\n",
+            drl_configfile.u.string);
         return false;
     }
 
     if (init_identities(configs, &limiter.stable_instance)) {
         free_failed_config(configs, &limiter.stable_instance);
+        printlog(LOG_CRITICAL, "Failed to initialize identities.\n");
         return false;
     }
 
@@ -1305,11 +1310,13 @@ static int init_drl(void) {
         case POLICY_FPS:
             if (assign_htb_hierarchy(&limiter.stable_instance)) {
                 free_instance(&limiter.stable_instance);
+                printlog(LOG_CRITICAL, "Failed to assign HTB hierarchy.\n");
                 return false;
             }
 
             if (create_htb_hierarchy(&limiter.stable_instance)) {
                 free_instance(&limiter.stable_instance);
+                printlog(LOG_CRITICAL, "Failed to create HTB hierarchy.\n");
                 return false;
             }
         break;
@@ -1317,6 +1324,7 @@ static int init_drl(void) {
         case POLICY_GRD:
             if (setup_tc_grd(&limiter.stable_instance)) {
                 free_instance(&limiter.stable_instance);
+                printlog(LOG_CRITICAL, "Failed to initialize tc calls for GRD.\n");
                 return false;
             }
         break;