- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Control-c to logout from from .profile
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
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
тАО10-17-2006 05:20 AM
тАО10-17-2006 05:20 AM
Can anyone help me, how to reslove this.
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-17-2006 05:43 AM
тАО10-17-2006 05:43 AM
Re: Control-c to logout from from .profile
Use Control d to logout.
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-17-2006 05:52 AM
тАО10-17-2006 05:52 AM
Re: Control-c to logout from from .profile
ctrl + D
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-17-2006 06:50 AM
тАО10-17-2006 06:50 AM
Re: Control-c to logout from from .profile
The eof control character determines which keystroke will result in a logout. The default setting is ^D (control-D), but this can be changed via 'stty eof
stty erase "^H" kill "^U" intr "^C" eof "^D"
and change "^D" to "
PCS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-17-2006 11:58 AM
тАО10-17-2006 11:58 AM
Re: Control-c to logout from from .profile
trap exit 2
You have to logout and login for it to
work. sourcing ". ./.profile" from command
line is not enough.
Or if your using .kshrc with .profile
just put it in .kshrc and source .kshrc.
Then it will work also.
Both will only work with the first evoked login shell and other sh shells evoked within the current shell but not any ksh
shells evoked within the current shell. ??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-18-2006 12:51 AM
тАО10-18-2006 12:51 AM
Re: Control-c to logout from from .profile
Thanks for responses.
I have Tried all those options which didn't work.
Here is the requirement; I am executing one script thru .profile. As soon as user logs in that menu script will execute he can choose the option based on his requirement, if user press Ctrl-C he will go to his home directory but our intension is user should not go to home directory
Tahnks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-18-2006 01:12 AM
тАО10-18-2006 01:12 AM
Re: Control-c to logout from from .profile
trap '' 2
or
trap 'echo "Control-C disabled."' 2
regards,
ivan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-18-2006 01:18 AM
тАО10-18-2006 01:18 AM
Re: Control-c to logout from from .profile
As I understnad your question, you are executing only one script in your user's profile and you want to completely log off the user when the script finishes.
If that is the case, one way is to 'exec' your script at the end of the profile:
...
exec /home/user/menu.sh
In '/home/user/menu.sh' add a trap that looks like:
trap '' INT QUIT
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-18-2006 01:47 AM
тАО10-18-2006 01:47 AM
SolutionYou should make a script that is equivalent to the current .profile of the menu script user(s). Place that script in some location that is accessible to all menu script users but not modifiable by them. Normally /usr/local/bin might be a good place.
(For example, the script might be named as /usr/local/bin/loginmenu)
Then you must make it so that the menu script can be used as a valid login shell. You must add the name of this script into /etc/shells file; if that file does not exist, create it and add the names of the standard system shells plus the name of your menu script:
/sbin/sh
/usr/bin/sh
/usr/bin/rsh
/usr/bin/ksh
/usr/bin/rksh
/usr/bin/csh
/usr/bin/keysh
/usr/local/bin/loginmenu
(This list of standard shells is copied from "man getusershell". It is the default list which is used if /etc/shells does not exist. If you create /etc/shells but forget to include the standard shells, you may lose the ability to log in.)
The last step is to change the menu script users' login shell to /usr/local/bin/loginmenu. This can be done using the command:
usermod -s /usr/local/bin/loginmenu someuser
or
chsh someuser /usr/local/bin/loginmenu
After this, the user's session ends if the loginmenu script stops executing for any reason.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-18-2006 04:58 AM
тАО10-18-2006 04:58 AM
Re: Control-c to logout from from .profile
trap 'menu.sh' INT