Repository navigation
Conversation
The single-instance guard used a bare kill -0 on the pid stored in scheduler.loop.pid. That file survives a reboot and Android reuses pids quickly, so the stored pid can belong to an unrelated live process. The guard then exits before the scheduler loop and the VDLU boot update. Record the boot_id next to the pid and only trust the pid when it was written during the current boot. Signed-off-by: Solomag <33348398+Solomag@users.noreply.github.com>
Same stale-pid exposure as service.sh: after a reboot the pid file can point at an unrelated live process. Compare scheduler.loop.boot with the current boot_id before signalling, and clean the marker on uninstall. Signed-off-by: Solomag <33348398+Solomag@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
service.shcan silently skip the scheduler loop and the VDLU boot update after a reboot, because its single-instance guard trusts a stale pid.The guard is
kill -0 "$(cat scheduler.loop.pid)". The pid file lives in/data/adb/vdbackup/logs/and survives reboots, and Android reuses pids quickly. In my test the stored pid was alive again as an unrelated system app, sokill -0succeeded andservice.shexited at the guard: the scheduler loop was not started, and the VDLU boot block below the guard never ran (pid file untouched,vdlu/boot.logempty, no update after 7+ minutes).This PR records the
boot_id(/proc/sys/kernel/random/boot_id) inscheduler.loop.bootnext to the pid and only treats the pid as a live loop when it was written during the current boot. Behaviour within one boot is unchanged. Ifboot_idis unreadable, both sides are empty and the guard behaves as before.Context: VD171/VD-Modules#1
Checklist
lang/<code>.jsonandREADME.<code>.mdwere updated (no UI change).git commit -s).service.shinstalled, so the full boot path is untested.Notes
uninstall.shalso didkill "$(cat scheduler.loop.pid)"with the same stale-pid exposure (after a reboot it could signal an unrelated process). The second commit applies the sameboot_idcheck there: it only signals the pid whenscheduler.loop.bootmatches the current boot, and removes the marker on uninstall. If the marker is missing (loop started by an older version), it simply does not kill and the loop ends at the next reboot, which the existing comment already accepts. Syntax-checked withsh -nonly.