I just installed
Ubuntu 14.04 beta2 and out of 25 tries either logging out, shutting down or restarting, my session didn't close
Firefox properly 23 times when exiting. The result is the Firefox tabs recovery page that never happens if I take the time to close Firefox manually beforehand.
Since it worked 2/25 times, it feels like a time problem where Ubuntu doesn't allow Firefox's process time to end (Ubuntu logs out in about 1-2s). I've never even received the "wait for Firefox? / shut down anyway?" dialogue box that I observed under 12.04.
So if I'm correct, how do I make it so that it waits? If not what is the issue and how do I solve the improper exiting?
I have no experience with managing profile or session config files and very little with bash (I understand it but am lousy at coding it). So if you can't answer but have an good article on how does the profiles/sessions work in Unix/Linux/Debian/Ubuntu (if the same) and/or how to make changes to the login/logout events, I'd be happy with that.
Edit: I made additional tests that further indicate it's a matter of time
wmctrl -c firefox; sleep 0.5; sudo shutdown now -rworks fine 100%
wmctrl -c firefox; sleep 0.2; sudo shutdown now -rworks fine 50%
wmctrl -c firefox; sudo shutdown now -rworks fine 10%
sudo shutdown now -r& wmctrl -c firefoxnever seems to work...
So as a workaround, how can I write
wmctrl -c firefox; sleep 0.5 in a file that resembles
bash_logout but for session logout?