]> git.ipfire.org Git - thirdparty/systemd.git/commit
generators: only redirect logging when invoked by systemd
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 13 Jul 2022 16:43:05 +0000 (18:43 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 15 Jul 2022 13:48:05 +0000 (15:48 +0200)
commit911017f0526df9d1477588afb1f26afacdab9511
tree57ae56fef1b2fd74193ab7602c30a6c845714ab2
parent494f4ee9c770e401ea3d570a9caf4b3058cf7758
generators: only redirect logging when invoked by systemd

We would always print output to the kmsg or journal, but that is only needed
and useful when invoked by systemd. So let's skip redirection unless we are
invoked by systemd. Otherwise, let's log normally. This makes test invocations
easier, and also helps when the generator is invoked by mistake. If redirection
is necessary, the generator can be invoked with SYSTEMD_LOG_TARGET=… even
during tests.
src/shared/generator.c