kapitainsky / RcloneBrowser

Simple cross platform GUI for rclone. Supports macOS, GNU/Linux, BSD family and Windows.
https://github.com/kapitainsky/RcloneBrowser
MIT License
2.28k stars 218 forks source link

lockFile is global for all users #162

Open izahn opened 3 years ago

izahn commented 3 years ago

I found that if more than one user in a multi-user linux environment tries to use rclone-browser at the same time we get message saying that "Rclone Browser is already running. Only one instance is allowed.".

It looks like https://github.com/kapitainsky/RcloneBrowser/blob/45bf7411839b0919c488a3e3a0a5272b50c9fc7b/src/main.cpp#L201 implements a global lock instead of a per-user lock. Is that intended? I've patched this up locally with

  char* lockLocalUserName = std::getenv("USER");
  QLockFile lockFile(tmpDir + "/." + lockLocalUserName + "RcloneBrowser_4q6RgLs2RpbJA.lock");

but I don't know if this is the right approach, or if the global lock was intentional.

kapitainsky commented 3 years ago

Yes this was my intention but indeed per user would be maybe be better - I will merge it

Thx!

On 13 Apr 2021, at 19:38, Ista Zahn @.***> wrote:

I found that if more than one user in a multi-user linux environment tries to use rclone-browser at the same time we get message saying that "Rclone Browser is already running. Only one instance is allowed.".

It looks like https://github.com/kapitainsky/RcloneBrowser/blob/45bf7411839b0919c488a3e3a0a5272b50c9fc7b/src/main.cpp#L201 https://github.com/kapitainsky/RcloneBrowser/blob/45bf7411839b0919c488a3e3a0a5272b50c9fc7b/src/main.cpp#L201 implements a global lock instead of a per-user lock. Is that intended? I've patched this up locally with

char* lockLocalUserName = std::getenv("USER"); QLockFile lockFile(tmpDir + "/." + lockLocalUserName + "RcloneBrowser_4q6RgLs2RpbJA.lock"); but I don't know if this is the right approach, or if the global lock was intentional.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kapitainsky/RcloneBrowser/issues/162, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADXJHOXYDTZQBZ6LVG75243TISFQ3ANCNFSM42335DAA.