|
4 | 4 | # that seems to have appeared in C10S |
5 | 5 | # TODO diagnose and fill in here |
6 | 6 | export def reboot [] { |
7 | | - # Sometimes systemd daemons are still running old binaries and response "Access denied" when send reboot request |
8 | | - # Force a full sync before reboot |
9 | | - sync |
10 | | - # Allow more delay for bootc to settle |
11 | | - sleep 30sec |
| 7 | + # Confirm root cause |
| 8 | + # loginctl show-session $(loginctl | awk '/tty/ {print $1}') |
| 9 | + loginctl |
| 10 | + busctl call org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager CanReboot |
| 11 | + journalctl -f -n0 & PID_J=sudo bash -c 'echo $!; sleep 0.1' # start follower in background if you want |
| 12 | + journalctl -u systemd-logind -f |
| 13 | + journalctl -u systemd-logind -n200 |
| 14 | + journalctl -b -n200 | sed -n '1,200p' |
| 15 | + journalctl -k -n200 |
| 16 | + ausearch -m USER_CMD -ts recent 2>/dev/null or true |
| 17 | + ausearch -m avc,USER_AVC -ts recent 2>/dev/null or true |
| 18 | + journalctl -b | grep -i "denied\|capability\|reboot\|sys_reboot" |
| 19 | + ps -o pid,comm -p 1 |
| 20 | + ps -o pid,comm -C systemd-logind |
| 21 | + capsh --print 2>/dev/null or true |
| 22 | + # Enable polkit permissions for test user (root or non-root) |
| 23 | + # to allow logind reboot non-interactively |
| 24 | + sudo sh -c 'cat >/etc/polkit-1/rules.d/49-allow-reboot.rules <<EOF |
| 25 | +polkit.addRule(function(action, subject) { |
| 26 | + if (action.id == "org.freedesktop.login1.reboot" || |
| 27 | + action.id == "org.freedesktop.login1.reboot-multiple-sessions" || |
| 28 | + action.id == "org.freedesktop.login1.power-off") { |
| 29 | +
|
| 30 | + if (subject.user == "root" || subject.isInGroup("wheel")) { |
| 31 | + return polkit.Result.YES; |
| 32 | + } |
| 33 | + } |
| 34 | +}); |
| 35 | +EOF' |
12 | 36 |
|
13 | 37 | tmt-reboot |
14 | 38 | } |
|
0 commit comments