Chromium doesn't shut down correctly on system shutdown/reboot.
Every time I open Chromium after a reboot (where I didn't manually close chromium first) I'm greeted by a message stating 'Chromium didn't shut down correctly' and am asked if I want to restore the previous session, despite having an option set to always pick up where I left off.
I've encountered this issue on other distros and was hoping there might be some fix bundled in with Omarchy. Looking around online there's been discussion of this issue for 10+ years and a myriad of supposed solutions.
yeah, as you've found out yourself: this is not an issue with omarchy! The fact it even asks you is an indicator for it actually shutting down correctly.
https://issues.chromium.org/issues/41140760 .. the age of this ticket is good for a quick laugh :P
Yeah, that is annoying. Hopefully in another 10 years it'll be sorted 😂.
Although I guess we could actually work around it with a pre-shutdown hook that close all apps before shutting down.
Although I guess we could actually work around it with a pre-shutdown hook that close all apps before shutting down.
UWSM does that: it "cleanly" shuts down application. Otherwise f.e. Firefox wouldn't restore tabs on re-opening.
UWSM does that: it "cleanly" shuts down application. Otherwise f.e. Firefox wouldn't restore tabs on re-opening.
Oh, you'd get this error too if you manually shut it down? Because it does seem like it's not working? I've seen that before too. If there's any way we can work around the problem, even if it's technically chrome's fault, I'm open to doing that.
I don't know.
I guess you'd add a exec-shutdown in hyprlands config to manually just "pkill chromium" (or something more sophisticated XD)?
taking a stab 🔪. it works on my local machine a simple: chrome::MarkAsCleanShutdown(); on SIGTERM, but need to verify, why simple change like this was not done in the last 11 years 😬 (there needs to be something)
ok this "fix" would solve it, but problem has deeper roots, hyperland sends SIGTERM and actually immediatly sends SIGKILL so no real time between, this is the reason why chrome cannot shutdown clean, above fix, marks the death as clean.
going to investigate into hyperland, how we could set a TERM->KILL timeout, as like other apps will suffer a potential dataloss too (office apps and stuff)
Maybe @vaxerski can help us understand what should be done here.
If you turn off hyprland, you turn off hyprland. Apps die. Standard procedure, we do not wait for them to close.
If you want to wait, you have to send SIGTERM / hyprctl dispatch closewindow address:... to each of them and wait until they close, yourself. Then exit Hyprland.
https://github.com/basecamp/omarchy/pull/1497 this fixes it the proper way for me!
wrap the shutdown/restart with a SIGTERM -> wait 3s -> SIGKILL
Is 3s arbitrary? Can’t we watch chrome close directly?
we could increase timeout some distros have up to 90s (too long if you ask me), but waiting for apps indefinitely feels wrong, as this could hang/block the shutdown! (hate this on macos)
the 3s worked fine for me with a decent amount of instances and tabs open
I've noticed if I have libvirt running on shutdown the system will wait, if it exits will shutdown, and otherwise if it hangs will wait for a timeout then shutdown. Can we do similar?
hmmm interesting - we should look how they do it. sounds like a plan. yet i prefer wait a few seconds but do it then (feels more linux like to me;when i say shutdown you should shutdown)
Check out my PR, i created a shutdown service script that runs with uwsm shutdown sequence, had to move browser out of uwsm to effectively terminate the browser, still looking to improve it further by moving service up the sequence of shutdown events.