5rahim / seanime

Open-source media server for anime and manga.
https://seanime.rahim.app
MIT License
395 stars 30 forks source link

During a selfupdate, replace the current process instead of opening a new terminal (Linux) #114

Closed zealain closed 2 months ago

zealain commented 2 months ago

After a self-update on Linux, the process running the updated executable would detach itself from the current process (and potentially run in a terminal emulator, although that seemed bugged). This means that it would no longer run under the same parent process. This can create problems if seanime is started as a background process. For example, I have a systemd service file that manages the seanime process. After an update, the new process would be detached and could no longer be controlled via systemctl.

After this change, the current process is replaced with the one running the updated executable and no new process is spawned. This fixes the systemd interaction and should increase compatibility as a whole by removing the hardcoded terminal emulators. It also propagates command line arguments, which didn't happen before.

This could potentially be adapted for the other operating systems, but I don't use those so I didn't investigate further.

5rahim commented 2 months ago

Thanks for the contribution. Did you manage to test it? If not I'll figure it out & merge it if everything's alright.

zealain commented 2 months ago

I have tested it, yes.

5rahim commented 2 months ago

Great, thank you.