]> git.ipfire.org Git - thirdparty/systemd.git/commit
log: introduce log_parse_environment_cli() and log_setup_cli()
authorFilipe Brandenburger <filbranden@gmail.com>
Wed, 17 Jun 2020 19:17:54 +0000 (12:17 -0700)
committerLennart Poettering <lennart@poettering.net>
Wed, 24 Jun 2020 14:49:26 +0000 (16:49 +0200)
commit41d1f469cf10f5f3e9cb4f4853ace9b0cfe5beae
tree5a8bbe67cfafb46b99daf93f219699f93b968a95
parenta1ba8c5b71164665ccb53c9cec384e5eef7d3689
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.
27 files changed:
src/analyze/analyze.c
src/basic/log.c
src/basic/log.h
src/busctl/busctl.c
src/cgls/cgls.c
src/cgtop/cgtop.c
src/coredump/coredumpctl.c
src/delta/delta.c
src/detect-virt/detect-virt.c
src/escape/escape.c
src/home/homectl.c
src/hostname/hostnamectl.c
src/id128/id128.c
src/journal-remote/journal-remote-main.c
src/journal-remote/journal-upload.c
src/journal/cat.c
src/journal/journalctl.c
src/locale/localectl.c
src/login/loginctl.c
src/machine/machinectl.c
src/network/networkctl.c
src/portable/portablectl.c
src/resolve/resolvectl.c
src/systemctl/systemctl.c
src/test/test-chase-symlinks.c
src/timedate/timedatectl.c
src/userdb/userdbctl.c