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

Suppress warning from systemd user session #5979

Merged
Merged
Show file tree
Hide file tree
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
5 changes: 4 additions & 1 deletion pyanaconda/display.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ def start_user_systemd():

# Start the user instance of systemd. This call will also cause the launch of
# dbus-broker and start a session bus at XDG_RUNTIME_DIR/bus.
childproc = util.startProgram(["/usr/lib/systemd/systemd", "--user"])
# Without SYSTEMD_LOG_TARGET variable the systemd is logging directly to terminal
# bypassing stdout and stderr
childproc = util.startProgram(["/usr/lib/systemd/systemd", "--user"],
env_add={"SYSTEMD_LOG_TARGET": "journal-or-kmsg"})
WatchProcesses.watch_process(childproc, "systemd")

# Set up the session bus address. Some services started by Anaconda might call
Expand Down
3 changes: 2 additions & 1 deletion tests/unit_tests/pyanaconda_tests/test_display.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ def test_start_user_systemd(self, util_mock, conf_mock, watch_mock):
start_user_systemd()

util_mock.startProgram.assert_called_once_with(
["/usr/lib/systemd/systemd", "--user"]
["/usr/lib/systemd/systemd", "--user"],
env_add={"SYSTEMD_LOG_TARGET": "journal-or-kmsg"}
)
watch_mock.watch_process.assert_called_once_with(
100, "systemd"
Expand Down