File tree Expand file tree Collapse file tree 1 file changed +25
-5
lines changed
Expand file tree Collapse file tree 1 file changed +25
-5
lines changed Original file line number Diff line number Diff line change 44# that seems to have appeared in C10S
55# TODO diagnose and fill in here
66export 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 - u systemd-logind - n200 -- no-pager
12+ journalctl - b - n200 | sed - n ' 1,200p'
13+ journalctl - k - n200 -- no-pager
14+ ausearch - m USER_CMD - ts recent 2 >/dev/null or true
15+ ausearch - m avc ,USER_AVC - ts recent 2 >/dev/null or true
16+ journalctl - b | grep - i " denied\|capability\|reboot\|sys_reboot"
17+ capsh -- print 2 >/dev/null or true
18+ # Enable polkit permissions for test user (root or non-root)
19+ # to allow logind reboot non-interactively
20+ sudo sh - c ' cat >/etc/polkit-1/rules.d/49-allow-reboot.rules <<EOF
21+ polkit.addRule(function(action, subject) {
22+ if (action.id == "org.freedesktop.login1.reboot" ||
23+ action.id == "org.freedesktop.login1.reboot-multiple-sessions" ||
24+ action.id == "org.freedesktop.login1.power-off") {
25+
26+ if (subject.user == "root" || subject.isInGroup("wheel")) {
27+ return polkit.Result.YES;
28+ }
29+ }
30+ });
31+ EOF'
1232
1333 tmt-reboot
1434}
You can’t perform that action at this time.
0 commit comments