Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
logout of gnome remotely via ssh?
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
carneboy
n00b
n00b


Joined: 11 May 2004
Posts: 63
Location: Riverside, CA

PostPosted: Tue Dec 21, 2004 12:59 am    Post subject: logout of gnome remotely via ssh? Reply with quote

i can't seem to find this on google.. but is there a command that i can run remotely (say via ssh) to logout of my gnome session?

short of just killing the process?
Back to top
View user's profile Send private message
Pithlit
l33t
l33t


Joined: 27 Dec 2003
Posts: 887
Location: fuhen

PostPosted: Tue Dec 21, 2004 2:24 am    Post subject: Reply with quote

if you start gnome with # startx ... # killall startx
Back to top
View user's profile Send private message
psyeye
Guru
Guru


Joined: 06 Dec 2002
Posts: 409
Location: Germany

PostPosted: Tue Dec 21, 2004 12:42 pm    Post subject: Re: logout of gnome remotely via ssh? Reply with quote

carneboy wrote:
i can't seem to find this on google.. but is there a command that i can run remotely (say via ssh) to logout of my gnome session?

short of just killing the process?


IF you log in as root, you can issue
Code:
/etc/init.d/xdm stop


That way, your user is thrown out of gnome and even X is takin' down.
Might be overkill...

Other idea:
I checked some manpages and came across
Code:
gnome-session-save --kill

As I understand it, is saves your sessions and exits - but I have not tested it...
(I'm interested to hear if gnome-session-save did the trick - please report... :))

psyeye
Back to top
View user's profile Send private message
carneboy
n00b
n00b


Joined: 11 May 2004
Posts: 63
Location: Riverside, CA

PostPosted: Tue Dec 21, 2004 6:02 pm    Post subject: Reply with quote

Pithlit: thanks for the help, although not quite the solution i was looking for. I was looking for something to log me out.. nicely

psyeye: again thanks for the help. the gnome-session-save --kill looked promising, but it only works if I issue it from an xterm within my gnome session, otherwise it says "GTk-WARNING **: cannot open display" (perhaps i need to play with it some more though.. i'll try it from work today)
Back to top
View user's profile Send private message
swanson
Tux's lil' helper
Tux's lil' helper


Joined: 04 Jun 2004
Posts: 147
Location: Edinburgh, Scotland

PostPosted: Tue Dec 21, 2004 6:32 pm    Post subject: Reply with quote

The following works;

$ export DISPLAY=:0
$ export XAUTHORITY=$HOME/.Xauthority
$ export SESSION_MANAGER="local/`hostname`:/tmp/.ICE-unix/`pidof gnome-session`"
$ gnome-session-save --kill

If you don't have pidof installed, use ps with a grep, an awk and a jump. :)

EDIT: Forgot to mention but if you have non-session aware applications running Metacity will print a warning window which stops the logout. Same thing you get the same in a normal session except without the ability to click.
_________________
Alan.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum