1826537 Members
3904 Online
109695 Solutions
New Discussion

who -Rm in dtterm fails

 
SOLVED
Go to solution
Donny Jekels
Respected Contributor

who -Rm in dtterm fails

when I excute who -Rm in hpterm on same server
it works.

however if I do it in a dtterm it I get nothing back.

any ideas?
"Vision, is the art of seeing the invisible"
10 REPLIES 10
John Meissner
Esteemed Contributor
Solution

Re: who -Rm in dtterm fails

try
who -mT
All paths lead to destiny
Donny Jekels
Respected Contributor

Re: who -Rm in dtterm fails

same problem.

just get the prompt back.
"Vision, is the art of seeing the invisible"
John Meissner
Esteemed Contributor

Re: who -Rm in dtterm fails

Are you trying to get your IP address to export your display?
All paths lead to destiny
John Meissner
Esteemed Contributor

Re: who -Rm in dtterm fails

is so try this also
last -R$ last -R | grep `logname` | grep in$ | sed -n '1p'

the display you're trying this on.... is it a terminal attached directly to the server?
All paths lead to destiny
John Meissner
Esteemed Contributor

Re: who -Rm in dtterm fails

darn typo.....
ignore the first last R$.... copied and pasted too much
should just be

last -R | grep `logname` | grep in$ | sed -n '1p'
All paths lead to destiny
Steven E. Protter
Exalted Contributor

Re: who -Rm in dtterm fails

Does who work without command line options?

I would guess not, so check your TERM variable. That is a possible culprit.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Jeff Schussele
Honored Contributor

Re: who -Rm in dtterm fails

Hi,

who -R tries to do name lookups.
So if you have a LOT of connections that are NOT listed in DNS or cannot be resolved by the method defined in nsswitch.conf, then you'll get a 30 second delay for EACH lookup failure.
This of course can add up to quite a few minutes of "no response". This may appear as a no response or a hang.
Let it run it's course to see if you EVER get a response.

Also a corrupt /etc/utmp could cause this, but it should also cause other who switches to fail as well.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
John Meissner
Esteemed Contributor

Re: who -Rm in dtterm fails

Donny - just curious but did any of these answers help you out? It's usually good to follow up at the end and let us know what works that way if someone else has this problem they'll be able to see what worked for you.
All paths lead to destiny
Donny Jekels
Respected Contributor

Re: who -Rm in dtterm fails

yes off course - thanks for the reminder.

this was my problem.
in a particular users .profile I do this
greet()
{
set -- $(who -Rm)
Machine=${6#\(}
Machine=${Machine%\)}
nslookup $Machine | grep Address | cut -f2 -d":" | read IP

..
.
.

}

it works on all the boxes over 90 of them.

on 3 others I had to modify the who -Rm to
who -uT

greet()
{
Machine=$(who -uT | awk '{print $9}')
nslookup $Machine | grep Address | cut -f2 -d":" | read IP
NAME=$(who -uT | awk '{print $1}')
.
.
.
}

not sure why this is happening on those boxes.
maybe I'll replace the /etc/umtp this weekend and check again.

"Vision, is the art of seeing the invisible"
Donny Jekels
Respected Contributor

Re: who -Rm in dtterm fails

for those who are interrested:

put this in your users .profile

greet()
{
set -- $(who -Rm)
Machine=${6#\(}
Machine=${Machine%\)}
nslookup $Machine | grep Address | cut -f2 -d":" | read IP
NAME=$(who -Rm | awk '{print $1}')
grep ${NAME} /etc/passwd|awk -F: '{print $5}'|awk '{print $1}'|read Name
HOUR=$(date +%H)
if [ $HOUR -le 12 ] && [ $HOUR -ge 0 ]
then
greet=Morning
elif [ $HOUR -gt 12 ] && [ $HOUR -lt 18 ]
then
greet=Afternoon
else
greet=Evening
fi
if mail -e
then
Mail=$(echo " You've got mail")
else
Mail=$(echo " sorry no mail at this time")
fi
printf "\n--------------------------------------------------------"
printf "------------------------\n"
printf "\n\t\tGood $greet, $Name,\t$Mail\n\n"
printf "\t\tYou logged in from:\n"
printf "\t\t\tIP address\t: $IP\n"
printf "\t\t\tDNS name\t: $Machine\n\n"
printf "\n\t\tToday is\t: `date +%A`\n"
printf "\t\tDate is\t\t: `date +%D`\n"
printf "\t\tTime is\t\t: `date +%H:%M`\n\n"
printf "\n\t\tYour Display is exported as ${IP}:0.0\n\n"
printf "\t\tYour terminal type is: `echo $TERM`\n"
printf "\n--------------------------------------------------------"
printf "------------------------\n"
export DISPLAY=${IP}:0.0
}

# don't show this banner when youhave jobs running from cron or other processes.
if [[ -t 0 && -t 1 ]]
then
greet
fi



enjoy
Donny
"Vision, is the art of seeing the invisible"