Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automatic Logout! 1

Status
Not open for further replies.

MrProgrammer

Programmer
Feb 1, 2002
41
TR
Hi,

I'm using Sun Solaris 5.8 and i have created a user. I want this user automaticly begin with a menu program when logged in. And I want him automaticly logout when he exits the program with normal ways or even by pressing such Ctrl+C key combinations. To achieve the first objective (automatic startup of the program) i created a .profile file in the default directory of that user. And it works fine. Whenever he logs in, he finds himself in the program. But he can easly exit program and enter shell prompt. I don't want this happen.

I am waiting for your suggestions.
Thanks!
 
I'd put in "trap" lines at the top of the users .profile. After these lines just add the script or program that you want to run. Follow this with an "exit". Maybe a profile looking a little like this:

trap 'print "Exiting login.";logout' INT
trap 'print "Exiting login.";logout' QUIT
trap 'print "Exiting login.";logout' TSTP

/usr/local/bin/custom-menu.sh

exit
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top