- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: auto logout
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-11-2009 07:45 AM
тАО02-11-2009 07:45 AM
We are calling an X-windows based application from the .profile via reflection X automatically . Once the user exit out the application , I want to logoff the shell automatically as we don't want them to get the $ prompt at all.
Tried with kill -9 $$ and some thing like
shown below. Buit the $ prompt still remain.How to logout the users automatically after he/she is done with the application?
.profile code to execute the application.
cd /home/somestuff
./run_the_application
./kill_it
--------
kill_it has the following lines
#!/bin/ksh
MYUSER=`whoami`
for MYPID in `ps -ef | grep $MYUSER | awk '{ print $(2) }' | sort -r`
do
`kill -9 $MYPID`
done
Solved! Go to Solution.
- Tags:
- logout
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-11-2009 08:07 AM
тАО02-11-2009 08:07 AM
Re: auto logout
cd /home/somestuff
exec ./run_the_application
"exec" causes "./run_the_application" to
replace the shell, so when it exits, the
process should die.
HP-UX-free example:
ALP $ rsh /user = root sol
Last login: Wed Feb 11 10:04:53 from alp-l.antinode.
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
You have new mail.
sol# pwd
/root
sol# exec pwd
/root
%RSH-S-REMCLOSED, Remote connection closed
ALP $
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-11-2009 08:48 AM
тАО02-11-2009 08:48 AM
Re: auto logout
.profile with exec ./run_the_application
doesn't stopped opening/executing the application from xterm. Then
I have done the following.But its not existing out the $ prompt in the xterm.
.profile :
exec ./call_run
call_run has the following lines.
#!/usr/bin/ksh
exec ./run_the_application
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-11-2009 08:57 AM
тАО02-11-2009 08:57 AM
Re: auto logout
.profile with exec ./run_the_application
stopped opening/executing the application itself from xterm. So I have done the following.But its not existing out the $ prompt in xterm.
.profile :
exec ./call_run
call_run has the following lines.
#!/usr/bin/ksh
exec ./run_the_application
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-11-2009 09:03 AM
тАО02-11-2009 09:03 AM
Re: auto logout
When you exit the application, it will proceed to the next statement in the .profile file and exit out.
cd /home/somestuff
./run_the_application
exit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-11-2009 09:06 AM
тАО02-11-2009 09:06 AM
Re: auto logout
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-11-2009 09:19 AM
тАО02-11-2009 09:19 AM
Re: auto logout
The 'exit' after the 'run_the_application' should have no effect on the command, UNLESS you are doing a './run_the_application &', in which case the exit will kill the application when the shell exits.
Verify you are not trying to run the command in the background.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-11-2009 09:21 AM
тАО02-11-2009 09:21 AM
Re: auto logout
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-11-2009 10:31 AM
тАО02-11-2009 10:31 AM
Re: auto logout
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-11-2009 11:01 AM
тАО02-11-2009 11:01 AM
Re: auto logout
> in the xterm.
What xterm? I think that you're hiding too
many details. Like who creates an xterm.
If you can provide a sample script which
really does something, then it might be
possible to suggest some changes. With no
information about who creates which process
how, running what, I'm lost.