- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- script to NOT logout a user after...
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
Forums
Discussions
Discussions
Discussions
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
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
01-13-2003 11:51 AM
01-13-2003 11:51 AM
script to NOT logout a user after...
On 10.20, I am creating a user that when he logs in, it will run a script automatically.
This part works great. Script is called from his .profile and this works fine.
My problem is that when the user exits the script, it logs him out.
I'd like this user to be able to get to the prompt should he need to.
Right now, he can't. If he exits the script (by answering "Yes" to my prompt "Do you wish to exit"), he is exited but logged off the system. I'd like to have him able to exit this script and be sitting at the prompt.
Any suggestions? TIA!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2003 11:55 AM
01-13-2003 11:55 AM
Re: script to NOT logout a user after...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2003 12:00 PM
01-13-2003 12:00 PM
Re: script to NOT logout a user after...
Provide an option in your script to launch a shell:
# sh
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2003 12:05 PM
01-13-2003 12:05 PM
Re: script to NOT logout a user after...
My best guess is that you are
executing your script in .profile this way
. myscript.sh
rather than
myscript.sh
In the former, myscript.sh is not a separate process; it is executed as part of the same shell; thus an exit in myscript.sh exits the shell. In the latter case, myscript.sh executes as a separate process and an exit from the child returns to the parent.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2003 12:05 PM
01-13-2003 12:05 PM
Re: script to NOT logout a user after...
This .profile is exactly like mine except for this is the last line for him:
# Set default menu
exec /d01/bin/admin01.sh
Here is admin01.sh:
:
MFG=/d01/86e
DB_prod=/d02/prod
export DB_prod MFG
stty intr '^c'
DLC=/d01/dlc
PATH=$PATH:$DLC
export PATH DLC
while :
do
clear
1 = Production Database
2 = SMENU
q = Quit
Enter Selection :\c"
read rsp
case "$rsp" in
1) $DLC/bin/_progres -db $DB_prod -pf $MFG/client.pf ;;
2) /d01/bin/smenu ;;
q|Q) exit ;;
esac
echo "Press enter to continue -->\c"
read x
done
If I run this script from my prompt by typing /d01/bin/admin01.sh....the script works fine and when I say "Q" to quit, I am dropped to the prompt....perfect.
But, like I said, I've put this into his .profile and when he logs in, the script runs....but when he says "Q" to quit, he is logged out.
Any ideas? TIA!!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2003 12:10 PM
01-13-2003 12:10 PM
Re: script to NOT logout a user after...
As Clay indicated, since you are running it as part of your profile, "exit" is exiting the shell (which is executing .profile also) and hence you are being logged out.
You can do it two ways. Take out the code and put it a seperate script and embed it in profile. You don't need to call it with . as it will be executed in a different shell.
The other way is to give one more option "say 3"
Put another case in your case statement and enter /usr/bin/sh (or ksh) for the option 3.
However, I would suggest to go with the first option.
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2003 12:13 PM
01-13-2003 12:13 PM
Re: script to NOT logout a user after...
Take out exec and you should be fine.
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2003 12:15 PM
01-13-2003 12:15 PM
Re: script to NOT logout a user after...
I just took at the exec and it is perfect!
THANK YOU THAnK YOU THAnk YOU!!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2003 12:16 PM
01-13-2003 12:16 PM
Re: script to NOT logout a user after...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2003 12:21 PM
01-13-2003 12:21 PM
Re: script to NOT logout a user after...
There is a protocol to express thanks in these forums.
;-)
-Sri