在 Oracle® Solaris 11.2 中管理网络文件系统

退出打印视图

更新时间: 2014 年 7 月
 
 

rpcinfo 命令

rpcinfo 命令可生成有关系统上正在运行的 RPC 服务的信息。使用以下命令语法可显示有关 RPC 服务的信息:

# rpcinfo [ –m | –s ] [ hostname ]

# rpcinfo [–T transport] hostname [ progname ]

# rpcinfo [ –t | –u ] [ hostname ] [ progname ]

–m

显示 rpcbind 操作的统计信息表

–s

显示所有已注册的 RPC 程序的简明列表

–T

显示有关使用特定传输或协议的服务的信息

–t

探测使用 TCP 的 RPC 程序

–u

探测使用 UDP 的 RPC 程序

transport

指定服务的传输或协议

hostname

指定服务器的主机名

progname

指定 RPC 程序的名称

有关可用选项的更多信息,请参见 rpcinfo(1M) 手册页。

如果未指定 hostname 的值,则使用本地主机名。您可以将 progname 替换为 RPC 程序编号,但是名称更常用。可以在不运行 NFS 版本 3 软件的系统上使用 –p 选项(而非 –s 选项)。

    此命令生成的数据可包括以下内容:

  • RPC 程序编号

  • 特定程序的版本号

  • 使用的传输协议

  • RPC 服务的名称

  • RPC 服务的所有者

示例 6-3  显示 RPC 服务信息
# rpcinfo -s bee |sort -n
   program version(s) netid(s)                                    service     owner
    100000  2,3,4     udp6,tcp6,udp,tcp,ticlts,ticotsord,ticots   portmapper  superuser
    100001  4,3,2     udp6,udp,ticlts                             rstatd      superuser
    100003  4,3,2     tcp,udp,tcp6,udp6                           nfs         1
    100005  3,2,1     ticots,ticotsord,tcp,tcp6,ticlts,udp,udp6   mountd      superuser
    100007  1,2,3     ticots,ticotsord,ticlts,tcp,udp,tcp6,udp6   ypbind      1
    100011  1         udp6,udp,ticlts                             rquotad     superuser
    100021  4,3,2,1   tcp,udp,tcp6,udp6                           nlockmgr    1
    100024  1         ticots,ticotsord,ticlts,tcp,udp,tcp6,udp6   status      superuser
    100068  5,4,3,2   ticlts                                        -         superuser
    100083  1         ticotsord                                     -         superuser
    100133  1         ticots,ticotsord,ticlts,tcp,udp,tcp6,udp6     -         superuser
    100134  1         ticotsord                                     -         superuser
    100155  1         ticotsord                                   smserverd   superuser
    100169  1         ticots,ticotsord,ticlts                       -         superuser
    100227  3,2       tcp,udp,tcp6,udp6                           nfs_acl     1
    100234  1         ticotsord                                     -         superuser
    390113  1         tcp                                           -         superuser
    390435  1         tcp                                           -         superuser
    390436  1         tcp                                           -         superuser
1073741824  1         tcp,tcp6                                      -         1

该示例显示了有关正在服务器上运行的 RPC 服务的信息。该命令生成的输出将通过 sort 命令按程序编号过滤,以使信息更具可读性。多个列出 RPC 服务的行已从本示例中删除。

您可以通过在服务器上选择特定的传输来收集有关特定 RPC 服务的信息。以下示例将检查通过 TCP 运行的 mountd 服务。

# rpcinfo -t bee mountd
program 100005 Version 1 ready and waiting
program 100005 Version 2 ready and waiting
program 100005 Version 3 ready and waiting

以下示例将检查通过 UDP 运行的 NFS 服务。

# rpcinfo -u bee nfs
program 100003 Version 2 ready and waiting
program 100003 Version 3 ready and waiting