Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

b4.4 bug: deprecate -t since it is gone in main, mixes poorly with -l, and exits when there is no preexisting log #1488

Merged
merged 1 commit into from
Nov 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 2 additions & 12 deletions ldms/src/ldmsd/ldmsd.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ int foreground;
int cfg_cntr = 0;
pthread_t event_thread = (pthread_t)-1;
char *logfile;
int log_truncate = 0;
char *pidfile;
char *bannerfile;

Expand Down Expand Up @@ -553,15 +552,6 @@ FILE *ldmsd_open_log()
return f;
}

if (log_truncate) {
int err = truncate(logfile, 0);
if (err) {
ldmsd_log(LDMSD_LERROR, "Could not truncate the log file named '%s'. errno=%d\n",
logfile, errno);
cleanup(12, "log truncate failed");
}
}

f = fopen_perm(logfile, "a", LDMSD_DEFAULT_FILE_PERM);
if (!f) {
ldmsd_log(LDMSD_LERROR, "Could not open the log file named '%s'\n",
Expand Down Expand Up @@ -634,7 +624,7 @@ void usage_hint(char *argv[],char *hint)
printf(" -v LEVEL, --log_level LEVEL The available verbosity levels, in order of decreasing verbosity,\n"
" are DEBUG, INFO, ERROR, CRITICAL and QUIET.\n"
" The default level is ERROR.\n");
printf(" -t, --log_truncate Truncate the log file at start if the log file exists.\n");
printf(" -t, --log_truncate Deprecated & disabled. Removed in future release.\n");
printf(" -L optlog, --log_config optlog Log config commands; optlog is INT:PATH\n");
printf(" Communication Options\n");
printf(" -x xprt:port:host\n"
Expand Down Expand Up @@ -2116,7 +2106,7 @@ int ldmsd_process_cmd_line_arg(char opt, char *value)
}
break;
case 't':
log_truncate = 1;
ldmsd_log(LDMSD_LWARNING, "-t option no longer supported\n");
break;
case 'x':
if (check_arg("x", value, LO_NAME))
Expand Down
Loading