- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- kill idle user
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
11-10-2004 03:55 PM
11-10-2004 03:55 PM
Re: kill idle user
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2004 08:48 PM
11-10-2004 08:48 PM
Re: kill idle user
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2004 09:21 PM
11-10-2004 09:21 PM
Re: kill idle user
who -u output looks the same as on HP-UX system. So the script should work.
Copy and paste the script exactly like it is. Add a 'done' at the end as i missed it.. It should work.
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2004 09:35 PM
11-10-2004 09:35 PM
Re: kill idle user
-Sri
PS: Give me 0 points for all the posts in this thread.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-11-2004 12:02 AM
11-11-2004 12:02 AM
Re: kill idle user
I run it , the error output like this, could suggest what should I make so that I can use it at Linux ? thx
kill_user: line 38: [: 175:: integer expression expected
edp_usr:175::12650:Untouched
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-11-2004 08:47 AM
11-11-2004 08:47 AM
Re: kill idle user
I've used this script for years and had no problems. It should work on Linux as well, albeit I don't have a Linux box to test on.
Later,
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2004 06:08 PM
11-17-2004 06:08 PM
Re: kill idle user
when I run Muth's script , i got the below error
./killuser: line 47: [: 00:09: integer expression expected ,
the line 47 is this line, i can run it smoothly at unix , could suggest how should I change it ? thx
if [ $time -gt $TIMEOUTT ]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2004 06:55 PM
11-17-2004 06:55 PM
Re: kill idle user
try using
while (($time > $TIMEOUTT))
do
.
.
.
.
done
instead of
if [ $time -gt $TIMEOUTT ]
Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2004 02:16 AM
11-18-2004 02:16 AM
Re: kill idle user
If you want to kill an idle user, why not just set the value of TMOUT=360 in the users shell.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2004 09:35 PM
12-07-2004 09:35 PM
Re: kill idle user
I still can't find the reason why my script can only run at unix but can't at linux box.
the error is
./kill_idle: line 38: [: 00:03: integer expression expected , where line 38 is "if [ $time -gt $TIMEOUT ]" , I tried the below but still can't run .
(1)
while (($time > $TIMEOUTT))
do
.
.
.
.
done
(2)
if [[ $time -gt $TIMEOUTT ]]
my script is as below , could suggest how can I modify it to make it work ? thx
#!/bin/sh
PATH=$PATH:/usr/bin:/usr/sbin:/usr/contrib/bin
TIMEOUT=40
EXCEPTIONLIST=~ckyoung/exception.lst
touch $EXCEPTIONLIST
kill_pid()
{
PID=$1
kill -9 $PID
}
echo "User:Activity:PID:Status"
who -u | while read line
do
time=$(echo $line | awk '{print $6}')
pid=$(echo $line | awk '{print $7}')
user=$(echo $line | awk '{print $1}')
grep -q "^${user}:" $EXCEPTIONLIST
if [ $? != 0 ]
then
if [ "$time" = "old" ]
then
(( time = $TIMEOUT + 1 ))
else
echo $time |grep -q "\."
if [ $? != 0 ]
then
time=$(echo $time|awk '{FS=":";print $1*60+$2}')
else
time=0
fi
fi
fi
#echo $time
if [ $time -gt $TIMEOUT ]
then
echo "$user:$time:$pid:Killed"
# Uncomment to do kill that PID
kill_pid $pid
else
echo "$user:$time:$pid:Untouched"
fi
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2004 12:58 PM
12-08-2004 12:58 PM
Re: kill idle user
- « Previous
-
- 1
- 2
- Next »