who

Hi all,

this is what I get from the output from the "who" command

# who -a |grep admin|sort
admin network Feb 4 17:56 . 6272 id=16:0 term=0 exit=0
admin network Feb 5 14:44 . 11403 id=71:0 term=0 exit=0
admin network Feb 7 17:36 . 28086 id=75:0 term=0 exit=0
admin network Feb 7 20:23 . 28745 id=11:0 term=0 exit=3
admin network Feb 8 14:18 . 3666 id=66:0 term=0 exit=0
admin network Feb 8 16:57 . 1437 id=67:0 term=0 exit=0
admin network Feb 8 18:00 . 5278 id=109: term=0 exit=0
admin network Feb 9 16:22 . 8325 id=03:0 term=0 exit=3
admin network Feb 11 12:33 . 17406 id=17:0 term=0 exit=0
admin network Feb 11 15:39 . 18951 id=07:0 term=0 exit=0
admin network Feb 11 17:09 . 18064 id=70:0 term=0 exit=0
admin network Feb 11 20:08 . 23179 id=14:0 term=0 exit=3
admin network Feb 12 08:17 . 25433 10.156.81.68:0
admin network Feb 12 08:46 . 25696 10.156.81.69:0
admin network Feb 12 09:06 . 25842 10.156.81.123:0
admin network Feb 12 09:09 . 26042 10.156.81.82:0
admin network Feb 12 09:12 . 25144 id=57:5 term=0 exit=0
admin network Feb 12 09:33 . 26224 id=84:0 term=0 exit=0
admin network Feb 12 09:59 . 26586 192.122.86.100:0
admin network Jan 30 12:57 . 1384 id=15:0 term=0 exit=0
admin network Jan 30 18:25 . 3227 id=19:0 term=0 exit=3
admin network Jan 31 18:26 . 13075 id=02:0 term=0 exit=0
admin ttyp1 Feb 12 09:44 0:22 26477 id= p1 term=0 exit=0
admin ttyp2 Feb 12 08:13 1:53 25392 id= p2 term=0 exit=0
admin ttyp3 Feb 12 09:02 1:04 25660 id= p3 term=0 exit=0
admin ttyp4 Feb 11 17:52 old 21988 id= p4 term=0 exit=0
admin ttyp5 Feb 12 10:05 . 26867 10.156.81.68:0.0
admin ttyp6 Feb 12 10:03 0:03 26021 id= p6 term=0 exit=0
admin ttyp7 Feb 11 18:22 15:44 22282 id= p7 term=0 exit=0
admin ttyp8 Feb 11 18:22 15:44 22286 id= p8 term=0 exit=0
admin ttyp9 Feb 11 19:02 15:04 22792 id= p9 term=0 exit=0
admin ttypa Feb 11 14:23 19:42 18927 id= pa term=0 exit=0
admin ttypb Feb 11 11:38 22:28 17130 id= pb term=0 exit=0
admin ttypc Feb 8 17:03 old 5416 id= pc term=0 exit=0
admin ttypd Feb 11 14:06 20:00 19538 id= pd term=0 exit=0
admin ttype Feb 11 17:09 20:55 18164 id= pe term=0 exit=0
admin ttypf Feb 11 17:09 16:56 18173 id= pf term=0 exit=0
admin ttyq0 Feb 11 14:35 old 19448 id= q0 term=0 exit=0

I want to kill all the users that have "network" next to them. When I do a ps -ef|grep network I get nothing. Any ideas at all please?

Cheers

When you do a "who -a", you get every entry in utmp. Entries like:
admin network Feb 7 20:23 . 28745 id=11:0 term=0 exit=3
admin network Feb 8 14:18 . 3666 id=66:0 term=0 exit=0
exist only to record the exit code of the terminated process.

Stopping unix from recording this information would require a modification to init at least and maybe login depending on how information you want to suppress.

I see, thanks for that.

Below basic help for the command "who" can be seen. If I do a "who -d" to see all the dead processes, this is what I get :

# who -d|sort
LOGIN network Feb 4 21:07
LOGIN network Feb 10 09:21
LOGIN network Feb 11 13:33
LOGIN pts/1 Feb 8 12:25
admin network Feb 4 17:56
admin network Feb 5 14:44
admin network Feb 7 17:36
admin network Feb 7 20:23
admin network Feb 8 14:18
admin network Feb 8 16:57
admin network Feb 8 18:00
admin network Feb 9 16:22
admin network Feb 11 12:33
admin network Feb 11 15:39
admin network Feb 11 17:09
admin network Feb 11 20:08
admin network Feb 12 09:12
admin network Feb 12 09:33
admin network Feb 12 11:53
admin network Feb 12 12:03
admin network Jan 30 12:57
admin network Jan 30 18:25
admin network Jan 31 18:26
admin ttyp1 Feb 12 09:44
admin ttyp2 Feb 12 08:13
admin ttyp6 Feb 12 10:03
admin ttyp7 Feb 11 18:22
admin ttypf Feb 11 17:09
admin ttyq0 Feb 11 14:35
bcheckrc . Jan 30 11:49
cat . Jan 30 11:49
rc . Jan 30 11:50
sh . Feb 12 08:58
sh . Feb 12 08:58
sh . Feb 12 08:58
sh . Jan 30 11:49

What I want to do is get rid of all the sessions before today(12/02/02), how can I do that ?

Cheers !

Usage: who [-rbtpludAasHTqRm] [am i] [utmp_like_file]

r run level
b boot time
t time changes
p processes other than getty or users
l login processes
u useful information
d dead processes
A accounting information
a all (rbtpludA options)
s short form of who (no time since last output or pid)
H print header
T status of tty (+ writable, - not writable, x exclusive open, ? hung)
q quick who
R print host name

Can anyone help please??

Thanks

There is nothing to get rid of. It is a history of what has happened on the system. It is not processes on the system.

I cannot think of any valid reason you would want to remove those entries unless....:eek:

Ok, let me rephrase then :

If I do a 'w' I get the below. ALL these are current connections, right?

# w
6:28pm up 13 days, 6:39, 6 users, load average: 2.48, 2.63, 2.65
User tty login@ idle JCPU PCPU what
admin network 6:05pm 3 -
admin network 10:09am 3 -
admin ttyp3 6:25pm 1 /usr/bin/noc/gnurdirect 10.156.64.65 20007 LOGIN_AUTO LOGIN_
admin ttyp4 6:25pm /usr/bin/noc/gnurdirect 10.156.64.65 10022 LOGIN_AUTO LOGIN_
root pts/0 6:28pm w
admin network 4:50pm 3 -

How can I kill the admin ones with the dash(-). I try to grep network but nothing shows up. If I grep ttyp3 for example I get the session and I can kill it. I want to kill the ones that have a - (dash) next to them but the proccess ID does not show up.

Sorry if I confuse you, let me know so I can provide more information if you need. Any help will be much appreciated.

Try variations on

ps -ef |grep admin |grep -v tty
to get processes not associated with a terminal and owned by admin.

I have tried all that. The initial problem was :

even if I kill ALL the admin proccess (everything, inlcuding vuesessions, ttyX, whatever) and do a "w" I still get "admin" logged in.
Doing a "ps -ef |grep admin" after that there is absolutely NOTHING.
I am logged in as root.
I don't want to reboot all the time.
Any ideas please?

Thanks

You wrote:
even if I kill ALL the admin proccess (everything, inlcuding vuesessions, ttyX, whatever) and do a "w" I still get "admin" logged in.
Doing a "ps -ef |grep admin" after that there is absolutely NOTHING.

I can think of couple of things but need more info:

  1. If there is no processes associated with the admin userid, then you may just have a bug in the who command and how it is getting information. What OS is this? Have you checked for this as a problem with the OS?

  2. What is the LOGIN_AUTO on the admin processes you posted? Is it possible this is a self-spawing processes? How soon after you kill off everything does it come back (the ones with - at the end)

  3. Ask yourself - are they doing anything, hurting the system in any way? What is the big deal (especially since you don't see them in a process status (ps -ef). Stop using who - problem solved.:slight_smile:

Thehoghunter, admins,

1) The operating system I am using is HP-UX B.10.20 A on 9000/785.

I don't think there is a bug with the "who" command.

2) The LOGIN_AUTO on the admin processes are remote "telnet" sessions to optical multiplexers used for provisioning.

3) The problem is that after a certain number of connected users the system hungs and no more users can log in. This is the reason I am trying to kill any inactive "admin" sessions that migh have left.
People using "exceed" to connect and sometimes (in the case of an error) they just have to close the window down without logging out properly. This leaves inactive sessions at the background without really people being connected. Also these sessions are associated with the appropriate "semaphores" which I have to manually kill all the time. (man ipcs)

Any help will be much appreciated.

I can't find anything on HPUX for this but maybe you have access to HP that I don't (my HPUX Guru is off today).

Check out this article (yes, I know it's not about hpux ). It may give you an idea of what you need to look at especially on the timeouts.

http://www.samag.com/documents/s=1323/sam0110e/

Anymore help concerning the problem above please ??

Cheers !

Here we go again, this is the output of the who -T command.

# who -T|sort
admin + console Feb 26 10:01 old 29754
admin + network Feb 22 16:45 0:01 7409 10.156.81.109:0
admin + network Feb 25 18:31 0:01 25505 10.156.81.68:0
admin + network Feb 26 09:02 0:01 28751 10.156.81.69:0
admin - ttyp5 Feb 26 10:07 0:01 581 preapp01:0.0
admin - ttypd Feb 25 11:57 21:40 20590 192.122.86:0.0
admin - ttyq1 Feb 25 16:54 17:16 24173 192.122.86:5.0
admin - ttyq2 Feb 25 16:54 17:16 24189 192.122.86:5.0
admin - ttyq3 Feb 25 16:54 17:16 24212 192.122.86:5.0
root - pts/0 Feb 26 10:11 . 665 coolp01

How can I kill (kick out) the user admin which resides on the "+ network"

Thank you all for your help. Please see above before you answer.