0

I asked this questions on Ubuntu Forums a couple of months ago but did not find a solution there, so I ask it again here.

I am using Ubuntu 16.04. I am trying to solve the problem that Chromium tells me on every startup that it "didn't shut down correctly". There is a long thread about this issue on Ubuntu Forums. But the solution proposed there, which is to put the command

kill -TERM $(pgrep chromium)

in the script /sbin/shutdown does not work in my case. Another proposed solution, namely to put the said command in a script in /etc/rc0.d does not work either. I also tried in the meantime (i.e., after posting on Ubuntu Forums) to put the line

session-cleanup-script=/link/to/script_with_kill_Chromium_command

in /etc/lightdm/lightdm.conf (which is the solution proposed in this Ask Ubuntu post), but that does not work either.

I guess that the reason why these proposed solutions don't work is that the command needs to be executed before the Xserver is terminated (given that Chromium is killed when the Xserver is terminated), but in the proposed solutions it is executed afterwards. The command in itself appears to work: When I execute it manually and then shutdown and restart, Chromium does not produce the "didn't shut down correctly" message. So my question is this: Is there a way to execute a command/script on shutdown before the Xserver is terminated?

Thanks in advance for your help!

  • This may help you https://superuser.com/questions/65460/create-a-logoff-script-task-for-linux#65526 – Arpit Agarwal May 27 '18 at 16:26
  • @ArpitAgarwal: Which part of the post you refer to do you have in mind? I don't see a part that would apply to Ubuntu 16.04. Besides, the answer given in the post says: "The Xserver is not running when the on-logout script is executed, so don't include any programs in the script that try to access the display". So that does not seem to be the right route for me. – Wolfhart May 28 '18 at 01:28

0 Answers0