derrod / legendary

Legendary - A free and open-source replacement for the Epic Games Launcher
https://legendary.gl/discord
GNU General Public License v3.0
4.59k stars 164 forks source link

Legendary lock not deleted when legendary is killed #613

Closed Etaash-mathamsetty closed 11 months ago

Etaash-mathamsetty commented 11 months ago

Basically what the title says

Platform

Operating system and version: Arch Linux Legendary version (legendary -V): latest git

Expected Behavior

Legendary should remove the lock after catching the signal, or put the PID in the lock so that another legendary process can realize that the other legendary process got killed.

Current Behavior

Legendary just exits, leaving the lock files behind.

Steps to Reproduce

  1. run some legendary command which creates a lock (installing a game)
  2. kill -15 (the pid)
  3. lock files remain

SIGKILL is uncatchable, so that case is understandable. It might also be a decent idea to put the lock files in a temporary location, so that they are cleaned up by the system after a reboot. (like /tmp)

derrod commented 11 months ago

The lock file existing shouldn't matter, it uses flock() (or Windows equivalent) which releases the actual lock once the process exits and the file is closed.

Etaash-mathamsetty commented 11 months ago

The lock file existing shouldn't matter, it uses flock() (or Windows equivalent) which releases the actual lock once the process exits and the file is closed.

yeah I noticed that it still worked properly after testing more, thanks