Skip to content

Commit

Permalink
Merge pull request #75 from Vogtinator/systemdbus
Browse files Browse the repository at this point in the history
Use race-free DBus API to silence systemd
  • Loading branch information
Guilherme Moro authored Feb 25, 2021
2 parents de3a6b0 + 0c8a6c4 commit feb35c5
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 @@ -58,7 +58,12 @@ 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
echo
}
Expand All @@ -67,9 +72,14 @@ 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 feb35c5

Please sign in to comment.