Skip to content

Commit

Permalink
Use race-free DBus API to silence systemd
Browse files Browse the repository at this point in the history
Only available in 246+, so keep a fallback.
  • Loading branch information
Vogtinator committed Jan 5, 2021
1 parent e920a15 commit 0c8a6c4
Showing 1 changed file with 14 additions and 4 deletions.
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

0 comments on commit 0c8a6c4

Please sign in to comment.