* @param[in] max_entries Max file descriptors to cache, and manage locks for.
* @param[in] max_idle Maximum time a file descriptor can be idle before it's closed.
* @param[in] locking Whether or not to lock the files.
+ * @param[in] triggers Should triggers be enabled.
* @param[in] trigger_prefix if NULL will be set automatically from the module CONF_SECTION.
* @param[in] trigger_args to make available in any triggers executed by the connection pool.
* @return
uint32_t max_entries,
fr_time_delta_t max_idle,
bool locking,
+ bool triggers,
char const *trigger_prefix,
fr_pair_list_t *trigger_args)
{
handle = exfile_init(ctx, max_entries, max_idle, locking);
if (!handle) return NULL;
- exfile_enable_triggers(handle, cf_section_find(module, "file", NULL), trigger_prefix, trigger_args);
+ if (triggers) exfile_enable_triggers(handle, cf_section_find(module, "file", NULL), trigger_prefix, trigger_args);
return handle;
}
uint32_t max_entries,
fr_time_delta_t max_idle,
bool locking,
+ bool triggers,
char const *trigger_prefix,
fr_pair_list_t *trigger_args);
/** @} */
bool escape; //!< do filename escaping, yes / no
exfile_t *ef; //!< Log file handler
+
+ bool triggers; //!< Do we run triggers.
} rlm_detail_t;
typedef struct {
{ FR_CONF_OFFSET("locking", rlm_detail_t, locking), .dflt = "no" },
{ FR_CONF_OFFSET("escape_filenames", rlm_detail_t, escape), .dflt = "no" },
{ FR_CONF_OFFSET("log_packet_header", rlm_detail_t, log_srcdst), .dflt = "no" },
+ { FR_CONF_OFFSET("triggers", rlm_detail_t, triggers) },
CONF_PARSER_TERMINATOR
};
rlm_detail_t *inst = talloc_get_type_abort(mctx->mi->data, rlm_detail_t);
CONF_SECTION *conf = mctx->mi->conf;
- inst->ef = module_rlm_exfile_init(inst, conf, 256, fr_time_delta_from_sec(30), inst->locking, NULL, NULL);
+ inst->ef = module_rlm_exfile_init(inst, conf, 256, fr_time_delta_from_sec(30), inst->locking,
+ inst->triggers, NULL, NULL);
if (!inst->ef) {
cf_log_err(conf, "Failed creating log file context");
return -1;
linelog_net_t udp; //!< UDP server.
CONF_SECTION *cs; //!< #CONF_SECTION to use as the root for #log_ref lookups.
+
+ bool triggers; //!< Do we do triggers.
} rlm_linelog_t;
typedef struct {
{ FR_CONF_OFFSET("delimiter", rlm_linelog_t, delimiter), .dflt = "\n" },
+ { FR_CONF_OFFSET("triggers", rlm_linelog_t, triggers) },
+
/*
* Log destinations
*/
}
if (!cf_pair_find(cs, "filename")) goto no_filename;
- inst->file.ef = module_rlm_exfile_init(inst, conf, 256, fr_time_delta_from_sec(30), true, NULL, NULL);
+ inst->file.ef = module_rlm_exfile_init(inst, conf, 256, fr_time_delta_from_sec(30), true,
+ inst->triggers, NULL, NULL);
if (!inst->file.ef) {
cf_log_err(conf, "Failed creating log file context");
return -1;
.always_escape = false,
};
- inst->ef = module_rlm_exfile_init(inst, conf, 256, fr_time_delta_from_sec(30), true, NULL, NULL);
+ inst->ef = module_rlm_exfile_init(inst, conf, 256, fr_time_delta_from_sec(30), true, false, NULL, NULL);
if (!inst->ef) {
cf_log_err(conf, "Failed creating log file context");
return -1;