Properly auto-close apps on shutdown/reboot

Hi,

running applications won’t be gracefully shut down on system shutdown or reboot. Chrome, Enpass and others will complain about unexpected quit.

Is there a way to properly close open apps, when the GNOME session ends?

Regards

Christian

Such grace shutdown is an action provided inside the service or application in question.

It is not an OS task to ensure app has flushed data before the system shuts down but they can inihibit the shutdown.

Services such as database engines is an example - but I don’t think userspace apps implement such thing.

Inside an application this is called a shutdown-hook. And it can be used to write some data, stop daemons, flush caches …, inform connected programs of the shutdown. Then exit gracefully.
:footprints:

1 Like

I wasn’t sure of the term on Linux - I have used it when coding Windows apps.

Dear all, as a developer myself I do know about hooks and events and stuff. Point is: Why doesn’t Chrome, Firefox et al get the chance to properly close down before system shutdown? This works out of the box on Windows and macOS.

I understand that issuing a system reboot from the command line will terminate all processes, without any of them being “prepared”. IMO that’s a bug, a desktop environment like GNOME should catch that event. Or, should it?

If you think it’s bug - take it to gitlab.gnome.org - they are the coders - they will know if it is a bug or intended behavior - I don’t know.

I close important applications before I shut down.

I even sync my work to github and codeberg before shutting down.

That said - now that I think about it - I have never seen any of my dev browsers complain.

I have Chromium, Edge, Firefox, Vivaldi - no one ever complains on being shutdown by the system.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.