@@ -122,6 +122,7 @@ typedef struct {
122122 exfile_t * ef ; //!< Exclusive file access handle.
123123 bool escape ; //!< Do filename escaping, yes / no.
124124 bool fsync ; //!< fsync after each write.
125+ fr_time_delta_t max_idle ; //!< How long to keep file metadata around without activity.
125126 } file ;
126127
127128 struct {
@@ -147,6 +148,7 @@ static const conf_parser_t file_config[] = {
147148 { FR_CONF_OFFSET ("group" , rlm_linelog_t , file .group_str ) },
148149 { FR_CONF_OFFSET ("escape_filenames" , rlm_linelog_t , file .escape ), .dflt = "no" },
149150 { FR_CONF_OFFSET ("fsync" , rlm_linelog_t , file .fsync ), .dflt = "no" },
151+ { FR_CONF_OFFSET ("max_idle" , rlm_linelog_t , file .max_idle ), .dflt = "30s" },
150152 CONF_PARSER_TERMINATOR
151153};
152154
@@ -966,7 +968,7 @@ static int mod_instantiate(module_inst_ctx_t const *mctx)
966968 }
967969 if (!cf_pair_find (cs , "filename" )) goto no_filename ;
968970
969- inst -> file .ef = module_rlm_exfile_init (inst , conf , 256 , fr_time_delta_from_sec ( 30 ) , true,
971+ inst -> file .ef = module_rlm_exfile_init (inst , conf , 256 , inst -> file . max_idle , true,
970972 inst -> triggers , NULL , NULL );
971973 if (!inst -> file .ef ) {
972974 cf_log_err (conf , "Failed creating log file context" );
0 commit comments