- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- unix script
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
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
12-21-2003 10:33 PM
12-21-2003 10:33 PM
We have 3 types of restrictions about the number of session allowed to each user.
Some user have permission to have 3 sessions open, some others 2 sessions open and some others only one session open.
We need to make a script or as the propose of Michael, we need to make a trap 1 in the users.profile, to kill the old session or hanging processes,when the users that has permission to have only one session open, try to open a second session, and this second session.
And in resume the old session has to be kill, when that kind of users open a new session, because only the new session must be working.
Please write that comands or script to make that????
Regards
Mario
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2003 11:03 PM
12-21-2003 11:03 PM
Re: unix script
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=291677
Instead of doing an echo you can do a kill of the old sessions
Good luck with it.
Regards,
Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2003 11:36 PM
12-21-2003 11:36 PM
Re: unix script
# Limita el número de sesiones en RCC
no_logins=`who|grep $LOGNAME|wc -l`
if [[ $no_logins -gt 3 ]]
then
echo "LO SIENTO, YA TIENES UNA SESION EN USO"
exit
fi
but if the user try to open a second session, the system, left hanging process, licence use, and for this reason we need to kill the old session when a user open a new session, this script will be only for users that have permission to have one session open.
Please give me script to make tha
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2003 11:47 PM
12-21-2003 11:47 PM
Re: unix script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2003 11:59 PM
12-21-2003 11:59 PM
Solutionmytty=`tty | sed 's/\/dev\///'`
no_logins=`who|grep $LOGNAME|wc -l`
if [[ $no_logins -gt 3 ]]
then
echo "LO SIENTO, YA TIENES UNA SESION EN USO"
echo"will now kill old sessions"
for p_id in `ps -u $LOGNAME | grep -v $mytty | grep -v PID | awk '{ print $1 }' i | sort -nr`
do
if [ `ps -p $p_id | wc -l` -eq 2 ]
then
kill $p_id
fi
done
exit
fi
Regards,
Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2003 12:10 AM
12-22-2003 12:10 AM
Re: unix script
should be like this:
for p_id in `ps -u $LOGNAME | grep -v $mytty | grep -v PID | awk '{ print $1 }' | sort -nr`
Replace line with above line.
Regards,
Peter