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

Use race-free DBus API to silence systemd #75

Merged
merged 1 commit into from
Feb 25, 2021
Merged
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
18 changes: 14 additions & 4 deletions files/usr/sbin/jeos-firstboot
Original file line number Diff line number Diff line change
Expand Up @@ -91,17 +91,27 @@ cleanup() {
echo .oOo.oOo.oOo. > $dialog_out
rm -f "$dialog_out"
# reenable systemd and kernel logs
run kill -s SIGRTMAX-10 1
# Try the race-free DBus method first
if ! run dbus-send --system --print-reply --dest=org.freedesktop.systemd1 /org/freedesktop/systemd1 \
org.freedesktop.systemd1.Manager.SetShowStatus string: &>/dev/null; then
# Fall back to using signals
run kill -s SIGRTMAX-10 1
fi
run setterm -msg on 2>/dev/null || true
}
trap cleanup EXIT

# avoid kernel messages spamming our console
run setterm -msg off 2>/dev/null || true
# Avoid systemd messages spamming our console
run kill -s SIGRTMAX-9 1
# sleep to avoid systemd bug, bsc#1119382
sleep 1
# Try the race-free DBus method first
if ! run dbus-send --system --print-reply --dest=org.freedesktop.systemd1 /org/freedesktop/systemd1 \
org.freedesktop.systemd1.Manager.SetShowStatus string:off &>/dev/null; then
# Fall back to using signals
run kill -s SIGRTMAX-9 1
# sleep to avoid systemd bug, bsc#1119382
sleep 1
fi

systemd_firstboot_args=('--setup-machine-id')

Expand Down