Operating System - HP-UX
1832753 Members
3159 Online
110045 Solutions
New Discussion

how to end a user's CDE session

 
SOLVED
Go to solution
curt larson_1
Honored Contributor

how to end a user's CDE session

what i'm looking to do is after the user logs on to have the dthello display it's message then return the user to the logon screen

if you have a non-zero exit code in Xstartup or in one of the Xsession scripts, the users session will be terminated but the dthello screen never gets displayed.

anyone have any suggestions?
5 REPLIES 5
Tamer Shaalan
Regular Advisor
Solution

Re: how to end a user's CDE session

Hi Curt,

To end the CDE session of a user, do the following :

login to its machine as root
# ps -ef | grep -i dtsession
you will see the process of the CDE session of that user ( or even others also )
you can kill the proces by :

kill PID

Tamer.
Success is a journey, not a destination
curt larson_1
Honored Contributor

Re: how to end a user's CDE session

yes, killing dtlogin will end the session. But, it doesn't return to the login screen.
dtlogin could be restated.

but, you end up with a process something like this:

running a process from Xstartup that will detect when dthello has finished, then kill dtlogin. Then to restart dtlogin, run an at job that will run at now+ some seconds.

any suggestions that aren't so complicated?
Tamer Shaalan
Regular Advisor

Re: how to end a user's CDE session

who said this will not bring login screen ??????

I use this method always to terminate any session , and -of course- the login screen is appaeared again.

But you should kill dtsession not dtlogin.

Tamer.
Success is a journey, not a destination
curt larson_1
Honored Contributor

Re: how to end a user's CDE session

Tamer,

you are right. if I kill dtsession as you suggested, that will terminate the session and the login screen will return, just as I'm wanting to occur.

Just one more wrinkle though. How do I know which dtsession is associated with the login on that is occuring.

what i'm doing is creating a backgroup process that runs from Xstartup that will kill the dtsession. But, when Xstartup is run dtsession hasn't started yet. So, the background proccess has to wait till dtsession is running, then kill it. Which is pretty easy to do when there is only one possible dtsession. But, suppose someone is logged in via a X-terminal. Now, there already is a dtsession running. I suppose I could just kill the next dtsession that started, but still would that dtsesstion be associated with this login and not another dtsession of another login occuring at nearly the same time.

I hope you understand the issue I'm having and can provide some suggestions?

thanks,
curt
curt larson_1
Honored Contributor

Re: how to end a user's CDE session

I found that running a script from /etc/dt/config/Xsession.d has the same pid as Xsession. and Xsession is the parent of dtsession. So, in my script I could just look for the dtsession that has as it's parent pid the pid of the script.