diff options
author | Filipe Brandenburger <filbranden@gmail.com> | 2020-06-17 21:17:54 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2020-06-24 16:49:26 +0200 |
commit | 41d1f469cf10f5f3e9cb4f4853ace9b0cfe5beae (patch) | |
tree | 5a8bbe67cfafb46b99daf93f219699f93b968a95 /src/locale | |
parent | feature to honor first shutdown request to completion (diff) | |
download | systemd-41d1f469cf10f5f3e9cb4f4853ace9b0cfe5beae.tar.xz systemd-41d1f469cf10f5f3e9cb4f4853ace9b0cfe5beae.zip |
log: introduce log_parse_environment_cli() and log_setup_cli()
Presently, CLI utilities such as systemctl will check whether they have a tty
attached or not to decide whether to parse /proc/cmdline or EFI variable
SystemdOptions looking for systemd.log_* entries.
But this check will be misleading if these tools are being launched by a
daemon, such as a monitoring daemon or automation service that runs in
background.
Make log handling of CLI tools uniform by never checking /proc/cmdline or EFI
variables to determine the logging level.
Furthermore, introduce a new log_setup_cli() shortcut to set up common options
used by most command-line utilities.
Diffstat (limited to 'src/locale')
-rw-r--r-- | src/locale/localectl.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/locale/localectl.c b/src/locale/localectl.c index b7548a0f7f..96fc09a570 100644 --- a/src/locale/localectl.c +++ b/src/locale/localectl.c @@ -502,9 +502,7 @@ static int run(int argc, char *argv[]) { int r; setlocale(LC_ALL, ""); - log_show_color(true); - log_parse_environment(); - log_open(); + log_setup_cli(); r = parse_argv(argc, argv); if (r <= 0) |