解决方法
我认为这样做:
gnome-session-save --logout
另外,看一下–help输出,也许你想使用–force-logout选项.
Usage: gnome-session-save [OPTION...] Help Options: -h,--help Show help options --help-all Show all help options --help-gtk Show GTK+ Options Application Options: --logout Log out --force-logout Log out,ignoring any existing inhibitors --logout-dialog Show logout dialog --shutdown-dialog Show shutdown dialog --gui Use dialog Boxes for errors --display=DISPLAY X display to use