Restarting Gnome-Shell from terminal
My Gnome-Shell had just gone bananas, so I needed to restart it (I’m using Gnome-shell 3.4, and this happens like 2 times per month). Normally I restart it from inside the shell or restart the login manager but I didn’t want to lose all the open programs, so I used the SIGHUP signal. For completness, here are all my ways of doing it.
Restarting from inside the Shell #
from inside the shell: alt+F2 , r, enter. You will not lose all the open programs.
Restarting gdm3 login manager from TTY #
One can restart the login manager, but that way you lose all the open programs that were inside the shell. Do it with:
sudo service gdm3 restart
Using SIGHUP signal from TTY #
SIGHUP signal was originally designed to notify the process of a serial line drop (a hangup). In modern systems, this signal usually means that the controlling pseudo or virtual terminal has been closed1 . So SIGHUP basically lets the programmer define the procedure to be executed when it’s received. Gnome developers have implemented such a prodecure that restarts the Gnome-shell, without killing child processes. Perfect! . You can use it with:
sudo killall -s SIGHUP gnome-shell
Víctor Cuadrado Juan
I'm Víctor Cuadrado Juan, a developer and FOSS enthusiast, currently living in Germany. These days I spend most of my time as one of Kubewarden's maintainers, a CNCF project, and contributing to Sigstore Rust libraries from time to time. I started my foray in Linux with Debian, where I also maintained some packages. I'm a firm supporter of libre software; it rescued my love for computer technology as a tool for humanity. Feel free to waste your precious time around here, or to contact me.