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 generate orphan process and multi-user problem #313

Closed rstech209 closed 2 years ago

rstech209 commented 2 years ago

I did some tests today with the suspend-sync function. I was able to verify that following the improvement made by smac89 (# 276) that inhibit lock is functional (I was able to reproduce the problem with the previous version and see the expiration of the InhibitDelayMaxSec timeout).

There is one more problem that remains: 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.

The proposed changes correct these problems.