In Ubuntu Desktop, there's a command to logout immediately, and the user can execute it without being at the login shell:
$ gnome-session-quit --logout --no-prompt
Q. What is the equivalent command in Ubuntu Server, if any?
(I'm aware that logout at a non-login shell is not allowed, but perhaps there's a different command. The preferred solution logs out gracefully instead of e.g., killing daemons.)
exitdoesn't work in a non-login shell is incorrect, it islogoutthat doesn't work. It isn't forbidden, it just doesn't make sense to logout if you aren't in a login shell. – Paul Dec 15 '11 at 2:42logoutcommand (regardless of whether it makes sense), wouldn't the command be considered "forbidden"? – superuser Dec 15 '11 at 4:37