I am having a situation where I logged in to a RHEL 5.6 system and started VirtualBox. After closing the VirtualBox, I am having a situation where the menu bar which has the option to shutdown or lock screen or log off the system is not present. I believe the reason might be due to network load or something.

I can shutdown or restart from the terminal, but again they take considerable amount of time.

All I need is to just Log off from the system when the menu bar is not present. I need to get the login screen like how we have, when we initially boot the system.

Is there any option to just Log off the user using the terminal?


ps -ax | grep dm output

Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.7/FAQ
 2352 ?        S<     0:00 [rdma_cm]
 2908 ?        Ss     0:00 rpc.idmapd
 3287 ?        Ss     0:00 sendmail: accepting connections
 3297 ?        Ss     0:00 sendmail: Queue runner@01:00:00 for /var/spool/clientmqueue
 3504 ?        Ss     0:00 /usr/sbin/gdm-binary -nodaemon
 3547 ?        S      0:01 /usr/sbin/gdm-binary -nodaemon
 3549 ?        S      0:00 /usr/libexec/gdm-rh-security-token-helper
 5080 tty7     Ss+    7:20 /usr/bin/Xorg :0 -br -audit 0 -auth /var/gdm/:0.Xauth -nolisten tcp vt7
18166 pts/1    S+     0:00 grep dm
  • What desktop environment are you using? – terdon Oct 23 '13 at 16:53
  • 1
    Sounds like you’re having a situation. – Martin Bean Oct 23 '13 at 16:54
  • I am using GNOME. – Ramesh Oct 23 '13 at 16:54
  • Should I use kill command and force logout the user? However, I am not sure if that would lead me to the login screen. – Ramesh Oct 23 '13 at 17:04

Possible ways to get logged out:

  • You kill the X server with a key combination: Ctrl-Alt-Backspace, if it is enabled,

  • You kill the process of the X server from any terminal (you have to be root, but you can do this through SSH remotely as well),

  • You ask the window or session manager to quit (how that can be achieved usually depends on the environment used),

  • You kill the process of the window or session manager from any terminal (you can do this as your own user or as root, and you can do this through SSH remotely as well),

  • You can stop & restart the display manager, if the session is run by a display manager (you have to be root, but you can do this through SSH remotely as well). The stopping display manager will kill all its sesssions.

How to know the PID of the X server? Usually, there is only a single X server running on the machine. It runs as root. The process name is usually something like X, or Xorg. It usually has an argument specifying the ID of that X server, :0 is the first display in the system. Sending a SIGTERM is usually the proper way to stop the X server, using SIGKILL will most probably result in an inproperly shut down graphics display.

How to know which process is the window or session manager? It depends on the environment used. Usually, this is the process that initially starts all processes belonging to the X session. It runs with the credentials of your user. pstree -up will show the graph of the processes.

How to know which process is the display manager? If the graphical display is started by a script (xinit, for example), there is no display manager. If the graphical display is reachable with XDMCP over the network, there is a display manager. The display manager is usually run as a system service, with whatever service running facility the OS is using (rc.d init scripts, systemd, upstart, etc). Older systems used the generic xdm as the display manager, newer desktop environments have their own display manager: gdm3 for GNOME, kdm for KDE, cde-login for CDE. Stopping & restarting is done by the appropriate OS service command.

  • +1 For the particular case of GNOME, you can run service gdm3 restart as root. Or possibly service gdm restart if you're using an older version of GNOME. – Joseph R. Oct 23 '13 at 17:43
  • @Joseph: thanks, I included the display manager solution as well. – Laszlo Valko Oct 23 '13 at 17:56
  • @JosephR., I do not see any of the services named gdm or gdm3. – Ramesh Oct 23 '13 at 18:31
  • @LaszloValko, Thanks for your detailed explanation. I see a process as xfs and another process as xinetd. These are the 2 processes, I am seeing that starts with X. – Ramesh Oct 23 '13 at 18:33
  • @Ramesh How do you log in? – Joseph R. Oct 23 '13 at 18:36

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.