]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
TEST-04-JOURNAL: use bash to make builtin echo command used
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 23 Jul 2025 18:34:26 +0000 (03:34 +0900)
committerLuca Boccassi <luca.boccassi@gmail.com>
Mon, 4 Aug 2025 14:52:15 +0000 (15:52 +0100)
When non-builtin echo command is used, then the command may exit before
journald find the source of the stream, and the log filtering may not be
applied.

Hopefully fixes #37143.

(cherry picked from commit 7532bc8718eb1c90fc822c2742bc2439ab6604e9)

test/integration-tests/TEST-04-JOURNAL/TEST-04-JOURNAL.units/logs-filtering.service
test/units/delegated_cgroup_filtering_payload.sh

index 6eca47d1fa41282e76aaaf8ba0ba25db22aa8476..3d28695902481703596614c738c828869002f96b 100644 (file)
@@ -5,6 +5,6 @@ Description=Log filtering unit
 Type=oneshot
 # If the service finishes extremely fast, journald cannot find the source of the
 # stream. Hence, we need to call 'journalctl --sync' before service finishes.
-ExecStart=sh -c 'echo "Logging from the service, and ~more~ foo bar"; journalctl --sync'
+ExecStart=bash -c 'echo "Logging from the service, and ~more~ foo bar"; journalctl --sync'
 SyslogLevel=notice
 LogLevelMax=info
index 6084ae8dcb5878804bcd8d9f03a532c5f85019b4..505dcf0cbe18aae364c02b29525f4329a68035a9 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 # SPDX-License-Identifier: LGPL-2.1-or-later
 
 mkdir /sys/fs/cgroup/system.slice/delegated-cgroup-filtering.service/the_child