|
|
|
|
@ -42,6 +42,7 @@ med_stats_period_t config_stats_period = MEDIATOR_DEFAULT_STATSPERIOD;
|
|
|
|
|
|
|
|
|
|
int config_maintenance = 0;
|
|
|
|
|
int strict_leg_tokens = 0;
|
|
|
|
|
int config_max_acc_age = 0;
|
|
|
|
|
|
|
|
|
|
med_loglevel_t config_loglevel = MEDIATOR_DEFAULT_LOGLEVEL;
|
|
|
|
|
|
|
|
|
|
@ -79,9 +80,10 @@ enum config_option {
|
|
|
|
|
OPT_STATS_PERIOD = 'x',
|
|
|
|
|
OPT_MAINTENANCE = 'm',
|
|
|
|
|
OPT_LEG_TOKENS = 's',
|
|
|
|
|
OPT_MAX_ACC_AGE = 'M',
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static const char options[] = "?a:c:e:D:i:dlL:h:u:p:b:o:H:U:P:B:O:S:t:T:r:R:A:N:Z:z:W:w:X:x:ms";
|
|
|
|
|
static const char options[] = "?a:c:e:D:i:dlL:h:u:p:b:o:H:U:P:B:O:S:t:T:r:R:A:N:Z:z:W:w:X:x:msM:";
|
|
|
|
|
|
|
|
|
|
struct option long_options[] = {
|
|
|
|
|
{ "configfile", required_argument, NULL, OPT_CONFIGFILE },
|
|
|
|
|
@ -117,6 +119,7 @@ struct option long_options[] = {
|
|
|
|
|
{ "stats-period", required_argument, NULL, OPT_STATS_PERIOD },
|
|
|
|
|
{ "maintenance", no_argument, NULL, OPT_MAINTENANCE },
|
|
|
|
|
{ "leg-tokens", no_argument, NULL, OPT_LEG_TOKENS },
|
|
|
|
|
{ "max-acc-age", required_argument, NULL, OPT_MAX_ACC_AGE },
|
|
|
|
|
{ NULL, 0, NULL, 0 },
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
@ -160,6 +163,7 @@ static void config_help(const char *self, int rc)
|
|
|
|
|
" -r, --redis-db DB\tThe redis usrloc db number (default = '%d').\n" \
|
|
|
|
|
" -m, --maintenance\tMaintenance mode (do nothing, just sleep).\n" \
|
|
|
|
|
" -s, --leg-tokens\tStrict acc fields (move to trash otherwise).\n" \
|
|
|
|
|
" -M, --max-acc-age\tMaximum age of acc records before trashing them (default = disabled).\n" \
|
|
|
|
|
" -?, --help\t\tDisplays this message.\n",
|
|
|
|
|
MEDIATOR_VERSION, self, MEDIATOR_DEFAULT_CONFIG_FILE,
|
|
|
|
|
MEDIATOR_DEFAULT_PIDPATH, MEDIATOR_DEFAULT_LOGLEVEL,
|
|
|
|
|
@ -296,6 +300,9 @@ static void config_set_option(enum config_option option, const char *value)
|
|
|
|
|
case OPT_LEG_TOKENS:
|
|
|
|
|
strict_leg_tokens = 1;
|
|
|
|
|
break;
|
|
|
|
|
case OPT_MAX_ACC_AGE:
|
|
|
|
|
config_max_acc_age = atoi(value);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|