Stop the update sleep inhibitor without a signal error (#13361)
Stopping stay-awake sends TERM to the held process, which was an exec'd sleep. systemd-inhibit reports a child killed by a signal as an error, so every update ended with "'/usr/bin/setpriv' terminated by signal TERM." The held process now stays a shell that traps TERM, kills its sleep, and exits cleanly. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e1614f2bdb
commit
8cd727dfdf
2 files changed
+8
-6
No files matched your search
@@ -446,8 +446,8 @@ pause = ': >"$TEST_CANCEL_READY"; while :; do /usr/bin/sleep 0.02; done'
|
||||
if sys.argv[2] == 'published':
|
||||
anchor = ' while :; do\n inhibit_record='
|
||||
edits = [(anchor, ' ' + pause + '\n' + anchor),
|
||||
(' exec -a "$expected"',
|
||||
' while [[ ! -e $TEST_RELEASE_CHILD ]]; do /usr/bin/sleep 0.02; done\n exec -a "$expected"')]
|
||||
(' trap "kill \\$!; exit 0" TERM',
|
||||
' while [[ ! -e $TEST_RELEASE_CHILD ]]; do /usr/bin/sleep 0.02; done\n trap "kill \\$!; exit 0" TERM')]
|
||||
elif sys.argv[2] == 'idle-temporary':
|
||||
anchor = ' temporary=$(mktemp "$state_dir/.${state_file##*/}.XXXXXXXX") || return 1'
|
||||
edits = [(anchor, anchor + '\n if [[ $state_file == "$idle_owner_file" ]]; then ' + pause + '; fi')]
|
||||
|
||||
Reference in new issue
Block a user