logging out a x session

logging out a x session

Post by Omon Edek » Fri, 21 Feb 2003 14:58:27



Dear all,
I am desperately trying to write a program to log out a user from a  linux
KDE/GNOME X window session.In trying to do this, I am killing all the
users' processes using kill(pid_t pid, SIGKILL) to all the users
processes. The user's processes actually do get killed but Xwindows
refuses to completely die out. An x server (?) is still running somewhere
in the background, and I WANT to completely stop it so that another user
can have a chance to login and run X windows.

Basically I amtrying to log out a user from an Xsession.Are there any
available signals that X windows catches that makes it to shutdown
correctly? Is there some order of how you kill the x processes? I am doing
a linear sequential traversal of the users processes and killing them all.
Is this the right approach to take?

Omon Edeki

www.cs.utexas.edu/users/omon

"Never.Never Give Up."

 
 
 

logging out a x session

Post by Timothy Murph » Fri, 21 Feb 2003 22:20:12



> I am desperately trying to write a program to log out a user from a  linux
> KDE/GNOME X window session.In trying to do this, I am killing all the
> users' processes using kill(pid_t pid, SIGKILL) to all the users
> processes. The user's processes actually do get killed but Xwindows
> refuses to completely die out. An x server (?) is still running somewhere
> in the background, and I WANT to completely stop it so that another user
> can have a chance to login and run X windows.

I've probably misunderstood,
but normally one does not stop X when someone logs out.
(In KDE you log out by clicking on the Start=>Logout button.)

You can get to a text console by Ctrl-Alt-F1,
and then return to X by Ctrl-Alt-F7.

But as I said, I've probably misunderstood your query.

--
Timothy Murphy  

tel: +353-86-233 6090
s-mail: School of Mathematics, Trinity College, Dublin 2, Ireland

 
 
 

logging out a x session

Post by Anton Vaaranma » Fri, 21 Feb 2003 22:52:37




> > I am desperately trying to write a program to log out a user from a  linux
> > KDE/GNOME X window session.In trying to do this, I am killing all the
> > users' processes using kill(pid_t pid, SIGKILL) to all the users
> > processes. The user's processes actually do get killed but Xwindows
> > refuses to completely die out. An x server (?) is still running somewhere
> > in the background, and I WANT to completely stop it so that another user
> > can have a chance to login and run X windows.
> I've probably misunderstood,
> but normally one does not stop X when someone logs out.

Then the definition of "normal" varies. Normally one starts his machine
to a text console mode, fires up X manually and when one logs out X
gets shut down and one is back in the text console again.

Quote:> You can get to a text console by Ctrl-Alt-F1,
> and then return to X by Ctrl-Alt-F7.

Yes, and if the OP wanted to only have a new session for a new user then
one alternative is to press Ctr-Alt-F2, login and issue "startx -- :1".

--
/(anton)

 
 
 

logging out a x session

Post by Christopher Brown » Fri, 21 Feb 2003 23:52:52




>> I am desperately trying to write a program to log out a user from a  linux
>> KDE/GNOME X window session.In trying to do this, I am killing all the
>> users' processes using kill(pid_t pid, SIGKILL) to all the users
>> processes. The user's processes actually do get killed but Xwindows
>> refuses to completely die out. An x server (?) is still running somewhere
>> in the background, and I WANT to completely stop it so that another user
>> can have a chance to login and run X windows.

> I've probably misunderstood,
> but normally one does not stop X when someone logs out.
> (In KDE you log out by clicking on the Start=>Logout button.)

> You can get to a text console by Ctrl-Alt-F1,
> and then return to X by Ctrl-Alt-F7.

> But as I said, I've probably misunderstood your query.

Actually, this is a fairly normal situation, usually associated with
running one of the "xdm" variants.  (Officially: xdm.  GNOME has gdm;
KDE has kdm; WindowMaker folk created wdm; there are probably
others...)

What is /supposed/ to happen is that when the process that owns the X
session dies, you'll get back to gdm/kdm/xdm, which likely involves X
dying and being respawned by gdm/kdm/xdm.

The problem appears to be that whatever process it is that X started
isn't dying.

I'm not sure what process winds up owning the session when you start
up with some "KDE control;" the process that X typically spawns, with
a "GNOME startup," is /usr/bin/gnome-session.  Kill /that/ and the X
session will almost certainly end.

To see what is causing the X session to linger, look for the X
process, and its children:


UID        PID  PPID  C STIME TTY          TIME CMD
root       966     1  0 Feb13 ?        00:00:03 /usr/bin/X11/xfs -daemon
root      1397  1357  2 Feb13 ?        03:23:19 /usr/bin/X11/X :1 -deferglyphs 16 -nolisten tcp vt7 -auth /var/lib/gdm/:1.Xauth
cbbrowne  6420 31481  0 09:00 pts/9    00:00:00 grep bin/X

root      1357  1356  0 Feb13 ?        00:00:00 /usr/bin/gdm
root      1397  1357  2 Feb13 ?        03:23:19 /usr/bin/X11/X :1 -deferglyphs 16 -nolisten tcp vt7 -auth /var/lib/gdm/:1.Xauth
cbbrowne  1411  1357  0 Feb13 ?        00:00:03 /usr/bin/gnome-session --purge-delay=15000
cbbrowne  6557 31481  0 09:01 pts/9    00:00:00 grep 1357

Notice that gdm (1357) spawned X (1397) and also spawned gnome-session
(1411).

Go after 1411 and that should end the session...
--

http://www3.sympatico.ca/cbbrowne/x.html
"Bother," said Pooh, as he deleted his root directory.

 
 
 

logging out a x session

Post by Jabali Pragy » Sat, 22 Feb 2003 05:43:55



> Dear all,
> I am desperately trying to write a program to log out a user from a  linux
> KDE/GNOME X window session.In trying to do this, I am killing all the
> users' processes using kill(pid_t pid, SIGKILL) to all the users
> processes. The user's processes actually do get killed but Xwindows
> refuses to completely die out. An x server (?) is still running somewhere
> in the background, and I WANT to completely stop it so that another user
> can have a chance to login and run X windows.

> Basically I amtrying to log out a user from an Xsession.Are there any
> available signals that X windows catches that makes it to shutdown
> correctly? Is there some order of how you kill the x processes? I am doing
> a linear sequential traversal of the users processes and killing them all.
> Is this the right approach to take?

I am not sure that I understood your querry exactly. If you want to stop
X, just press ALT-CTRL-Backspace. You will be back to the login screen.

--

jabali

 
 
 

logging out a x session

Post by Timothy Murph » Sat, 22 Feb 2003 08:51:37



>> I've probably misunderstood,
>> but normally one does not stop X when someone logs out.

> Then the definition of "normal" varies. Normally one starts his machine
> to a text console mode, fires up X manually and when one logs out X
> gets shut down and one is back in the text console again.

The poster said he was running KDE, IIRC.
Surely very few people run KDE by starting in text-mode, as you suggest.
Why on earth would you?

--
Timothy Murphy  

tel: +353-86-233 6090
s-mail: School of Mathematics, Trinity College, Dublin 2, Ireland

 
 
 

logging out a x session

Post by Anton Vaaranma » Sat, 22 Feb 2003 18:12:31




> >> I've probably misunderstood,
> >> but normally one does not stop X when someone logs out.
> > Then the definition of "normal" varies. Normally one starts his machine
> > to a text console mode, fires up X manually and when one logs out X
> > gets shut down and one is back in the text console again.
> The poster said he was running KDE, IIRC.

Yeah, but he did not say that he starts up to X automatically and
handles login with a display manager (xdm, kdm, gdm etc).

Quote:> Surely very few people run KDE by starting in text-mode, as you
> suggest.

Do you have any data for this? Most linux-users I talk to don't default
to X starting automatically (runlevel 5 in Red Hat). It probably is the
safest not to assume anything to what runlevel people start their
linuces ;-)

Quote:> Why on earth would you?

Not all tasks - in fact the majority of tasks don't - require a graphical user
interface.

--
/(anton)

 
 
 

logging out a x session

Post by PDoc » Sun, 23 Feb 2003 02:58:11





>> >> I've probably misunderstood,
>> >> but normally one does not stop X when someone logs out.

>> > Then the definition of "normal" varies. Normally one starts his machine
>> > to a text console mode, fires up X manually and when one logs out X
>> > gets shut down and one is back in the text console again.

>> The poster said he was running KDE, IIRC.

> Yeah, but he did not say that he starts up to X automatically and
> handles login with a display manager (xdm, kdm, gdm etc).

>> Surely very few people run KDE by starting in text-mode, as you
>> suggest.

> Do you have any data for this? Most linux-users I talk to don't default
> to X starting automatically (runlevel 5 in Red Hat). It probably is the
> safest not to assume anything to what runlevel people start their
> linuces ;-)

>> Why on earth would you?

> Not all tasks - in fact the majority of tasks don't - require a graphical
> user interface.

Another reason for runlevel 3 is to be able to utilize .bash_login and
.bash_logout. Actually X can be set by the user to immediately start upon
level 3 login. I would consider using [xkg]dm if I could find the
equivalent of $HOME/.bash_logout.  While the startkde script references
$KDEDIRS/shutdown the packaged 3.1 version in Slackware does not have a
/shutdown directory.
Would appreciate any info on what the startkde script is referencing or
other hints to achieve a bash_logout when using a graphical login.

ppd

 
 
 

1. Can apache/stronghold log when a user 'click outs' of your site?

If I have a link to a URL on another server, can I log when a user
clicks this link? (sort of like HTTP_REFERRER, but the inverse)

Example:

My site is www.A.com and I have a link to www.B.com along with
www.C.com, www.D.com, etc... I want to know if a user clicks on any of
these links.

Is this possible?

Thanks greatly,
Chuck

2. grep RE

3. How can I log everything what a user does in a session

4. SuperMicro P5MMA vs ChainTech 5TTM

5. How to log telnet session?

6. [2.5.20] bluesmoke merge

7. Logging User Sessions

8. Solaris ARP response behavior

9. log ftp session with PAM

10. login sessions keep on using CPU power after being logged out.

11. how to log popper sessions under aix

12. Log Session

13. logging ftp sessions