graysky2 / profile-sync-daemon

Symlinks and syncs browser profile dirs to RAM thus reducing HDD/SDD calls and speeding-up browsers.
https://wiki.archlinux.org/index.php/Profile-sync-daemon
Other
899 stars 84 forks source link

psd-suspend-sync #315

Closed rstech209 closed 9 months ago

rstech209 commented 2 years ago

Description and solution of the problem initially proposed in PR #313 deleted by mistake

rstech209 commented 2 years ago

I think that's OK now...I rewrite the PR #317 to fix this problem... History: By testing psd-suspend-sync function, I was able to verify that following the improvement made by smac89 (# 276) that inhibit lock is functional (by reproducing the problem with the previous version and see the expiration of the InhibitDelayMaxSec timeout).

There is one more problem remaining: A process gdbus monitor --system --dest org.freedesktop.login1 becomes orphan after each resume. That's because killing the script psd-suspend-sync does not stop this process.

In addition, I found that killing the script psd-suspend-sync after each resume and restarting 2 gdbus processes by cycle (one process initialized with the coproc for suspend (when creating the inhibit lock) and one process for resume), is not optimal.

On the other hand, the release_inhibit_lock () function of the main script will try to kill the psd-suspend-sync script regardless of the user (because of the pgrep -cf "psd-suspend-sync" command) and will generate error messages. This situation is problematic in a multi-user environment.