1748086 Members
5132 Online
108758 Solutions
New Discussion юеВ

who -r not working

 
SOLVED
Go to solution
Roman Schmidt
Frequent Advisor

who -r not working

hello,

i have a hp-ux B.11.11 machine here where the command who -r gives an empty output, return value is zero.

the who command itself does work, the /etc/inittab and /sbin/init seem OK.

where could i start to search for the problem?

is there another way to see the current runlevel?
15 REPLIES 15
Mark McDonald_2
Trusted Contributor

Re: who -r not working

you may be able to work out the current run lever from the last entries in the /etc/rc.log and compare these with what is in /etc/rc?.d

Can you post the output of:
whence who
Roman Schmidt
Frequent Advisor

Re: who -r not working

'whence who' gives me:

/usr/bin/who
Roman Schmidt
Frequent Advisor

Re: who -r not working

btw.

the last 100 entries '/etc/rc.log' are:

AxInitLocale: Error occurred during locale and conversion initialization.
Dennis Handly
Acclaimed Contributor

Re: who -r not working

If "who -r" doesn't work, /etc/utmp has been corrupted/emptied.

See these other threads about runlevel:
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1239710
INIT_STATE=s

http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1238202
who -r not working in single user mode.

It also mentions the command getrunlvl.
Roman Schmidt
Frequent Advisor

Re: who -r not working

hello, thanks for your reply, but still i don't get the point.

(note: i won't be able to reboot / change runlevels of the machine because it's a customer's server)

getrunlvl doesn't give me any output either, the machine wasn't rebooted for 200 days now and /etc/utmp isn't empty.


'strings /etc/utmp' gives me:

root@asbd4z :/root/home/root :strings /etc/utmp
root
consconsole
ts/1pts/1
ts/2pts/2
ts/3pts/3

B<ts/4pts/4
pB<ts/5pts/5

B<ts/6pts/6

ts/7pts/7
ermclnt
ts/0pts/0

Bpts/ta

pts/1
I8S5
LOGIN
pts/2



i replaced every ip with and every username with . except that it's exactly the content of the file.


maybe it has something to do with that storm of:

AxInitLocale: Error occurred during locale and conversion initialization.

in the /etc/rc.log? (although that file was last modified over 3 months ago)
Dennis Handly
Acclaimed Contributor

Re: who -r not working

>I won't be able to reboot / change runlevels of the machine because it's a customer's server

Since the machine is up, your runlevel is fine. Is your problem some script that insists on checking the runlevel and that's failing?

>getrunlvl doesn't give me any output either

Hmm, I forgot what that looks at. You could use tusc to check.

>the machine wasn't rebooted for 200 days now and /etc/utmp isn't empty.

It could be corrupted.
What does this show:
/usr/sbin/acct/fwtmp < /etc/utmp
Roman Schmidt
Frequent Advisor

Re: who -r not working

seems that the customer needs that command, he asked us to fix this issue.

here the output of '/usr/sbin/acct/fwtmp < /etc/utmp':

root cons console 8064 7 0000 0001 1219995548 Aug 29 09:39:08 2008
ts/1 pts/1 2278 8 0000 0000 1229333766 Dec 15 10:36:06 2008
ts/2 pts/2 10408 8 0000 0000 1235750764 Feb 27 17:06:04 2009
ts/3 pts/3 29760 7 0000 0000 1237570989 Mar 20 18:43:09 2009
ts/4 pts/4 2157 7 0000 0000 1237571440 Mar 20 18:50:40 2009
ts/5 pts/5 2986 7 0000 0000 1237592505 Mar 21 00:41:45 2009
ts/6 pts/6 7449 8 0000 0000 1237309059 Mar 17 17:57:39 2009
ts/7 pts/7 27854 8 0000 0000 1229612171 Dec 18 15:56:11 2008
ermclnt 22780 8 0000 0000 1237569841 Mar 20 18:24:01 2009
ts/0 pts/0 14496 7 0000 0000 1237200158 Mar 16 11:42:38 2009
LOGIN ta pts/ta 1910 8 0000 0000 1233141984 Jan 28 12:26:24 2009
1 pts/1 22654 8 0000 0000 1228428085 Dec 4 23:01:25 2008
LOGIN 2 pts/2 25517 8 0000 0000 1233140892 Jan 28 12:08:12 2009


i replaced the usernames by und the ip's with .


i've attached the output of 'tusc who -r' as well. (i've X'd out the usernames).

Thanks for the help.
Patrick Wallek
Honored Contributor

Re: who -r not working

It looks like pwgr (password & group caching daemon) is running. Try stopping this and then running your 'who -r' again.

# /sbin/init.d/pwgr stop

# who -r

If you want to restart it:

# /sbin/init.d/pwgr start

You could then try the 'who -r' again and see if just stopping and restarting pwgr "fixed" the problem.

No, stopping pwgr will not prevent anyone from logging in and should not have any other adverse effects.

I never run this on any of my servers. From what I have read it is really only useful if there are a lot of users logging in and out.
Roman Schmidt
Frequent Advisor

Re: who -r not working

yes, this service is running.


root@xxxxxx :/root/home/root :/sbin/init.d/pwgr stop
pwgrd stopped
root@xxxxxx :/root/home/root :who -r
root@xxxxxx :/root/home/root :/sbin/init.d/pwgr start
pwgrd started
root@xxxxxx :/root/home/root :who -r
root@xxxxxx :/root/home/root :


no change :(