2

Problem: When I reboot or shutdown ubuntu, and have chrome opened, I think chrome close normally, but not, and after start ubuntu and reopen chrome it say: chrome has closet anomaly, and you want to restore tabs?(something like that.).

Want: close chrome normally before shutdown or reboot, and start normally without error message about anomaly close.

I try to create an init script and it didn't work, I reboot or shutdown Ubuntu with chrome opened, then start chrome and test open chrome and see if it closed normally, but it din't.

Script for close Chrome

#!/bin/sh
killall -1 chrome

Path of script

# path script
etc/init.d/closeChrome

How I create

# how I create script for reboot and shutdown
sudo ln -s /etc/init.d/closeChrome /etc/rc0.d/K00closeChrome
sudo ln -s /etc/init.d/closeChrome /etc/rc6.d/K00closeChrome
sudo chmod a+x /etc/init.d/closeChrome

Update 31/12/2018: The script does its function, it execute before Ubuntu shutdown, but I think chrome close before script starts, maybe Ubuntu close sessions and their programs.

Upate 05/01/2019: Try to reinstall chrome.

Upate 06/01/2019: try remove selected from "Settings -> System -> Continue running background apps when Google Chrome is closed"

Update 16/01/2019: Try to use /etc/gdm3/PostSession/Default but gdm3 Default never executed on shutdown computer.

  • I would reinstall Chrome. Usually when I have a repeated issue like this it is due to some sort of configuration corruption. – LeinardoSmtih Dec 31 '18 at 17:54
  • Reinstalling Chrome is completely irrelevant advice for this issue. Chrome needs to be stopped prior to the desktop environment being stopped. Essentially what is needed is a more up to date version of this answer: askubuntu.com/a/604709/7143 but for Ubuntu 18.04 where lightdm is no longer in use. – Maks Jan 10 '19 at 23:41
2

Update 1 Mar 2019

This bug has now been marked as fixed and expected to ship in Chrome 74 or later:


Taken from this answer, you need to add the following line into your /etc/gdm3/PostSession/Default:

killall -HUP chrome

Note you will need root (eg. sudo) access to edit that Default file.

| improve this answer | |
  • This didn't work, I tried with reboot and shutdown, and chrome still ask about to restore last session. any other advice ? – DarckBlezzer Jan 12 '19 at 20:17
  • sorry I didnt actually get a chance to fully test this when I posted, just ran the script directly and you are correct, it still seems to run too late. Looking at the docs it seems that the X server is already gone by this stage so thats probably why:help.gnome.org/admin/gdm/stable/configuration.html.en#scripting I'll need to do some more reasch to try to find a point early enough to do this – Maks Jan 12 '19 at 22:50
  • 1
    actually this looks like some sort of bug in gdm3 as it appears that /etc/gdm3/PostSession/Default never actually gets run when shuting down! Its been reported in other questions: askubuntu.com/questions/1072616/… but Im not really prepared to take the derasitc measures suggested in that answer. – Maks Jan 13 '19 at 22:48
  • Thanks @Maks for your time, effort and help in this, I will continue searching a solution. – DarckBlezzer Jan 14 '19 at 16:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.