Operating System - HP-UX
1834149 Members
2807 Online
110064 Solutions
New Discussion

Is there anyway to determine service/program from rpcinfo -p output

 
SOLVED
Go to solution
Jack C. Mahaffey
Super Advisor

Is there anyway to determine service/program from rpcinfo -p output

We had a problem a couple of weeks ago with a port allocated on startup and then a secondary program that relied on the port would not start.

rpcinfo -p shows the program number (integer), version (integer), port (integer), and service (alphanumberic).

The program that attached to the port did not have a service entry. I looked in /etc/rpc and it does not already exist.

Here's a sample output:
/usr/bin/remsh wicoptp1 /usr/bin/rpcinfo -p
program vers proto port service
100000 4 tcp 111 rpcbind
100000 3 tcp 111 rpcbind
100000 2 tcp 111 rpcbind
100000 4 udp 111 rpcbind
100000 3 udp 111 rpcbind
100000 2 udp 111 rpcbind
100024 1 tcp 49152 status
100024 1 udp 49155 status
100021 1 tcp 49153 nlockmgr
100021 1 udp 49156 nlockmgr
100021 3 tcp 49154 nlockmgr
100021 3 udp 49157 nlockmgr
100021 4 tcp 49155 nlockmgr
100021 4 udp 49158 nlockmgr
100020 1 udp 4045 llockmgr
100020 1 tcp 4045 llockmgr
100021 2 tcp 49156 nlockmgr
351456 1 udp 811
351456 1 tcp 812
805306352 1 tcp 847
100005 1 udp 49174 mountd
100005 3 udp 49174 mountd
100005 1 tcp 49176 mountd
100005 3 tcp 49176 mountd
100003 2 udp 2049 nfs
100003 3 udp 2049 nfs
100068 2 udp 49176 cmsd
100068 3 udp 49176 cmsd
100068 4 udp 49176 cmsd
100068 5 udp 49176 cmsd
100083 1 tcp 49183 ttdbserver

In this sample I'm interest in learning which program is 805306352 and 351456.

Is there any technique to backtrack using the program Number to determine which program opened the port?

Once I know the program number I'll also place a corresponding entry in /etc/rpc.


Thanks...
Jack

2 REPLIES 2
Jeff Schussele
Honored Contributor
Solution

Re: Is there anyway to determine service/program from rpcinfo -p output

Hi Jack,

TCP port 847 is commonly used for DHCP Failover 2.
Ports 811 -through-> 827 are unassigned.
So I'd use lsof to track down just what is using 812.

Here's a good link to look up TCP port assignments.

http://compnetworking.about.com/library/ports/blports_glossary800.htm


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

Re: Is there anyway to determine service/program from rpcinfo -p output

I would suggest lsof and plug in the port number:

lsof -i :847

Should give you something like this (only on port 22 in this example):

root> lsof -i :22
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
sshd 1297 root 3u inet 0x01c1fc00 0t0 TCP *:22 (LISTEN)
sshd: 25370 root 4u inet 0x0194ef00 0t258242 TCP chop:22->jd3786nt:1162 (ESTABLISHED)
If it has wheels or a skirt, you can't afford it.