- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: limt user function
Categories
Company
Local Language
Forums
Discussions
Knowledge Base
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Forums
Discussions
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
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
12-08-2005 07:23 AM
12-08-2005 07:23 AM
Any Ideas?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2005 07:30 AM
12-08-2005 07:30 AM
Re: limt user function
At the beginning of the script do a:
trap "" 1 2 3
At the end of the script do an:
exit
So your script looks like:
# cat /dir/scriptname
#!/usr/bin/sh
trap "" 1 2 3
...
...
...
do your stuff here
...
...
...
exit
The linke in the passwd file would be:
users:*:9999:99:GECOS STUFF:/user/homedir:/dir/scriptname
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2005 07:31 AM
12-08-2005 07:31 AM
Re: limt user function
Use exit in the end of the script. This will make the user logged off after the script is finished.
Also change the interrupt character like Ctrl+c to something else ,so it willnot break the script. ex : stty intr ^u or something like that ,
Hope this will help ,
cheers,
Raj.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2005 07:56 AM
12-08-2005 07:56 AM
Re: limt user function
In /etc/passwd
sms:***:111:113:SMS inventory,,,:/home/sms:/home/sms/sh_sm
In sh_sms:
#cat /home/sms/gatherer.s
#!/usr/bin/sh
trap "" 123
/home/sms/gatherer.sh
exit
Once the sms user logged on the script did not run and was at the command prompt.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2005 08:02 AM
12-08-2005 08:02 AM
Re: limt user function
What you have should work provided permissions are correct.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2005 08:04 AM
12-08-2005 08:04 AM
Re: limt user function
You show the entry in '/etc/passwd' as:
/home/sms/sh_sm
Yet you list the script as if the name is:
/home/sms/sh_sms
...with a trailing "s".
Is that a posting error?
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2005 08:11 AM
12-08-2005 08:11 AM
Re: limt user function
-rwxr-r-xr-x sms readonly sh_sms
-rwxr-xr-x sms readonly gatherer.sh
Then I got a error about the trap syntax.
Adjusted the syntax to trap " " 1 2 3
All is working.
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2005 08:15 AM
12-08-2005 08:15 AM
Re: limt user function
The s was left off when I copied the items over from the term window.
Thank you,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2005 08:22 AM
12-08-2005 08:22 AM
Solution- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2005 08:25 AM
12-08-2005 08:25 AM
Re: limt user function
Thank you Patrick about setting the correct secuirty, it gave me the sytax error at that point and all is well.