Close gnome session from console

Solution 1:

The following command is an alternative for the gnome-session-quit (logout) which should close the session cleanly (not killing the gdm):

dbus-send --session --type=method_call --print-reply --dest=org.gnome.SessionManager /org/gnome/SessionManager org.gnome.SessionManager.Logout uint32:1.

(it's one line)

Solution 2:

That should do it for your 'username' session

# pkill -KILL -u username