Tauon icon indicating copy to clipboard operation
Tauon copied to clipboard

Gracefully shut down when killed by session shutting down

Open jansol opened this issue 3 years ago • 9 comments

If tauon gets killed by the session ending because the user hit the shut down or reboot button, state is not saved like it is when tauon is closed manually via the menu or the window close button. Would be nice if it did.

AFAIK the way to do this on Linux is to set up a handler for the TERM signal and perform the usual shutdown routine when that signal is received.

jansol avatar Mar 22 '22 21:03 jansol

This should work already. It should also inhibit shutdown until tauon has fully saved its state. There must be some issue somewhere. What desktop environment are you using?

Taiko2k avatar Mar 29 '22 03:03 Taiko2k

KDE Plasma 5.24.3

It seems that issuing a reboot from the command line works as expected, but if I reboot via the reboot button in the plasma main menu tauon state does not get saved. Instead, when I boot the PC and launch tauon again it ends up restoring a much earlier state (i.e. the one from when tauon was last shut down correctly).

jansol avatar Mar 30 '22 01:03 jansol

And yea, the Wayland variant of that desktop environment specifically.

jansol avatar Mar 30 '22 01:03 jansol

If you launch Tauon from terminal then term it, you should see it gracefully shut down. How long does it take? If it's less than say 3 secs then that should be fast enough I would have thought...

Taiko2k avatar Mar 30 '22 01:03 Taiko2k

When I was testing the wayland fixes I did just that, and it would usually shut down within ~2s. Sadly it was also not entirely uncommon for it to get stuck for 30s or so at which point I'd just Ctrl+C it.

jansol avatar Mar 30 '22 01:03 jansol

How many tracks in database does Tauon say for you under Stats?

Taiko2k avatar Mar 30 '22 01:03 Taiko2k

Tracks in playlist: 12,009
Albums in playlist: 884

Tracks in database: 23,848
Total albums: 884

Seems like it's got quite a few duplicates there. Probably because I recently set up a read only bind-mount of my music library and told tauon to use that instead of the original writable directory. Doesn't look like there is a way to purge those old paths either...

jansol avatar Mar 30 '22 01:03 jansol

Aand just as I posted that I noticed the "Clean Database" menu item.

jansol avatar Mar 30 '22 01:03 jansol

Still, 23k should be well within safe.

Taiko2k avatar Mar 30 '22 01:03 Taiko2k

Okay, looks like this is a Plasma Wayland issue: https://bugs.kde.org/show_bug.cgi?id=461176 https://bugs.kde.org/show_bug.cgi?id=436318

jansol avatar Jun 25 '23 15:06 jansol