feedburner
Enter your email address:

Delivered by FeedBurner

feedburner count

Howto Restart Gnome Panel

Labels: ,

It doesn't happen a lot but it does sometimes when the Gnome Panel freeze. If you are a former windows user you might be used to restart the computer when something in you desktop stuck. This is not the way with Linux. We can fix the problem by restarting the desktop session (restarting the X server) pressing the Ctrl+Alt+BackSpace but this will destroy everything we worked on so far. A more elegant way will be to restart only the Gnome Panel.

Getting access to the Linux command line shell


In order to restart the Gnome Panel we will need to execute the Linux kill command. Once the Gnome Panel process is killed Gnome will restart it automatically so the only thing left for us is to kill the Gnome Panel process. In order to execute the Linux kill command we will need to get access to the Linux shell. This can be done by one of the following:
  1. Pressing Alt+F2
  2. Using an opened console window using the Alt+Tab buttons to navigate to it.
  3. Using a console session by pressing Ctrl+Alt+F1


Killing the Gnome Panel


In each of these options we will need to execute the Linux kill command in order to kill the Gnome Panel process. There are two ways to use the kill command:
  1. Using the application name will kill all the applications with the same name
  2. Using the process id (pid) will kill only the process with the specified id.
Back to our case with the Gnome Panel, we can use both of the options.

Getting the Gnome Panel Process Id


First we will need to find the process id of the Gnome Panel. We can do it by listing the running processes on the system and filtering the ones with the word panel.

$ ps -ef | grep panel
shimik 19301 6584 0 09:13 ? 00:00:04 gnome-panel
shimik 20367 19254 0 09:35 pts/7 00:00:00 grep panel

We can see that there are two processes which were started by the user shimik, the first one is the gnome-panel process with the 19301 process id and the second is the grep command which we used to filter out the processes.

Restarting the Gnome Panel using the kill command


Now that we know the process id of the Gnome Panel we can kill it by using the following command

$ kill -9 19301


Restarting the Gnome Panel using the killall command


In order to use the killall command, we need to know the Gnome Panel process name. Looking back at the process list

$ ps -ef | grep gnome-panel
shimik 19301 6584 0 09:13 ? 00:00:04 gnome-panel
shimik 20367 19254 0 09:35 pts/7 00:00:00 grep panel

We can see that the Gnome Panel process name is gnome-panel.
Now we can use the killall command to kill the Gnome Panel process.

$ killall gnome-panel


After killing the gnome panel process gnome will restart the panels and we can continue our work without loosing the things we have done so far.

Although this explanation is about Gnome Panel restart in fact it describes the ways to restart, any Linux process so you can use it whenever you need to close/terminate a process.

7 comments:
gravatar
teto said...
November 8, 2008 at 10:48 AM  

the process for gnome-panel is 19301. The text is wrong.

gravatar
mylinuxnotebook said...
November 8, 2008 at 12:00 PM  

@teto
Thanks, I corrected it.

gravatar
wgrant said...
May 25, 2010 at 3:48 PM  

The process id will be different for everyone.

gravatar
Jeff said...
June 28, 2010 at 6:30 PM  

The process number for each process varies from computer to computer. So, people will have to kill whatever process number their gnome-panel is.

gravatar
jsantos said...
February 9, 2011 at 5:36 PM  

Don't use the -9 switch, that will kill using SIGKILL which doesn't allow the process to clean up after itself. Simply use kill or killall without any arguments but the PID or name of the process.

gravatar
Bruno Furtado said...
March 28, 2011 at 1:55 AM  

Hi,

I'm using FC 14 with 3 panels (top, bottom, left). The one on the left was marked to auto hide and never showed up again.

The problem was solved by restarting gnome-panels process.

Thanks a lot!

gravatar
theBrig said...
May 11, 2012 at 7:44 PM  

You can do this a a normal user from a gnome-terminal using the following command:

pkill gnome-panel

The auto restart of the process causes it to recover.

Post a Comment