Is there a way using command-line/bash to safely close down Chromium (running multiple tabs), that will not cause the application to shutdown incorrectly.

Using (for example):

$ pkill -3 chromium

(man signal shows -3 indicates the signal SIGQUIT)

(which I understand is how the shutdown command would terminate an application)
Causes Chromium to give the following error message when you next start it:

enter image description here



pkill -x -15 chromium-browser


pkill -x chromium-browser

the default value is -15 equal to SIGTERM.

From Wikipedia:

The SIGTERM signal is sent to a process to request its termination. Unlike the SIGKILL signal, it can be caught and interpreted or ignored by the process. This allows the process to perform nice termination releasing resources and saving state if appropriate. SIGINT is nearly identical to SIGTERM.

PS: pkill -3 chromium was only an illustration of how may a session lost happen.

  • Thanks again @Ravexina. Would you be able to elaborate on the difference between pkilling chromium vs chromium-browser, and why shutdown, reboot and logout are not using this safe termination method in their processes? – Broadsworde Aug 14 '18 at 11:01
  • I'm sure the commands you mentioned are sending the correct SIGNAL, they used to send SIGTERM. The Idea with SIGTERM is that the process (chromium in this case) can decide what to do. Because the system is getting shutdown chromium may decides to inform you that your session suddenly has been lost (Not by you) or it does not have enough time to cleanly close itself and system goes down before it get cleanly shutdown (chromium). My example in your previews question was only intended to reproduce the error. – Ravexina Aug 14 '18 at 11:09
  • pkill chromium may terminate other process which they name contains chromium while pkill chromium-browser will only terminate the browser (uniqe name) it's even better to use it like pkill -x chromium-browser (x exact name). – Ravexina Aug 14 '18 at 11:10
  • In Ubuntu 18.04, how could I make this to be executed immediately after triggering a restart or a shutdown? – Jaime Hablutzel May 25 at 19:14

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.