{
    "mode": "man",
    "parameter": "rpc.statd",
    "section": "8",
    "url": "https://www.chedong.com/phpMan.php/man/rpc.statd/8/json",
    "generated": "2026-05-30T07:08:50Z",
    "synopsis": "rpc.statd [-dh?FLNvV] [-H prog] [-n my-name] [-o outgoing-port]\n[-p listener-port] [-P path]\n[--nlm-port port] [--nlm-udp-port port]",
    "sections": {
        "NAME": {
            "content": "rpc.statd - NSM service daemon\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "rpc.statd [-dh?FLNvV] [-H prog] [-n my-name] [-o outgoing-port]\n[-p listener-port] [-P path]\n[--nlm-port port] [--nlm-udp-port port]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "File locks are not part of persistent file system state.  Lock state is thus lost when a host\nreboots.\n\nNetwork file systems must also detect when lock state is lost because a remote host  has  re‐\nbooted.   After  an NFS client reboots, an NFS server must release all file locks held by ap‐\nplications that were running on that client.  After a server reboots, a  client  must  remind\nthe server of file locks held by applications running on that client.\n\nFor  NFS version 2 [RFC1094] and NFS version 3 [RFC1813], the Network Status Monitor protocol\n(or NSM for short) is used to notify NFS peers of reboots.  On Linux, two separate user-space\ncomponents constitute the NSM service:\n",
            "subsections": [
                {
                    "name": "rpc.statd",
                    "content": "A  daemon that listens for reboot notifications from other hosts, and manages the list\nof hosts to be notified when the local system reboots\n"
                },
                {
                    "name": "sm-notify",
                    "content": "A helper program that notifies NFS peers after the local system reboots\n\nThe local NFS lock manager alerts its local rpc.statd of each remote peer that should be mon‐\nitored.   When  the  local  system reboots, the sm-notify command notifies the NSM service on\nmonitored peers of the  reboot.   When  a  remote  reboots,  that  peer  notifies  the  local\nrpc.statd, which in turn passes the reboot notification back to the local NFS lock manager.\n"
                }
            ]
        },
        "NSM OPERATION IN DETAIL": {
            "content": "The  first file locking interaction between an NFS client and server causes the NFS lock man‐\nagers on both peers to contact their local NSM service to store information about  the  oppo‐\nsite peer.  On Linux, the local lock manager contacts rpc.statd.\n\nrpc.statd  records information about each monitored NFS peer on persistent storage.  This in‐\nformation describes how to contact a remote peer in case the local  system  reboots,  how  to\nrecognize  which  monitored peer is reporting a reboot, and how to notify the local lock man‐\nager when a monitored peer indicates it has rebooted.\n\nAn NFS client sends a hostname, known as the client's callername, in each file lock request.\nAn  NFS  server can use this hostname to send asynchronous GRANT calls to a client, or to no‐\ntify the client it has rebooted.\n\nThe Linux NFS server can provide the client's callername or the client's network address  to\nrpc.statd.   For the purposes of the NSM protocol, this name or address is known as the moni‐\ntored peer's monname.  In addition, the local lock manager tells rpc.statd  what  it  thinks\nits  own  hostname  is.   For  the  purposes  of  the NSM protocol, this hostname is known as\nmyname.\n\nThere is no equivalent interaction between an NFS server and a client to inform the client of\nthe  server's  callername.   Therefore NFS clients do not actually know what monname an NFS\nserver might use in an SMNOTIFY request.  The Linux NFS client uses the server hostname from\nthe mount command to identify rebooting NFS servers.\n",
            "subsections": [
                {
                    "name": "Reboot notification",
                    "content": "When  the  local system reboots, the sm-notify command reads the list of monitored peers from\npersistent storage and sends an SMNOTIFY request to the NSM service on  each  listed  remote\npeer.   It uses the monname string as the destination.  To identify which host has rebooted,\nthe sm-notify command sends the myname string recorded when that remote was monitored.   The\nremote  rpc.statd matches incoming SMNOTIFY requests using this string, or the caller's net‐\nwork address, to one or more peers on its own monitor list.\n\nIf rpc.statd does not find a peer on its monitor list that matches an incoming SMNOTIFY  re‐\nquest,  the  notification is not forwarded to the local lock manager.  In addition, each peer\nhas its own NSM state number, a 32-bit integer that is bumped after each reboot by the sm-no‐‐\ntify  command.  rpc.statd uses this number to distinguish between actual reboots and replayed\nnotifications.\n\nPart of NFS lock recovery is rediscovering which peers need to be monitored again.   The  sm-\nnotify command clears the monitor list on persistent storage after each reboot.\n"
                }
            ]
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "-d --no-syslog",
                    "content": "Causes  rpc.statd to write log messages on stderr instead of to the system log, if the\n-F option was also specified.\n",
                    "flag": "-d",
                    "long": "--no-syslog"
                },
                {
                    "name": "-F --foreground",
                    "content": "Keeps rpc.statd attached to its controlling terminal so that NSM operation can be mon‐\nitored  directly  or run under a debugger.  If this option is not specified, rpc.statd\nbackgrounds itself soon after it starts.\n",
                    "flag": "-F",
                    "long": "--foreground"
                },
                {
                    "name": "-h -? --help",
                    "content": "Causes rpc.statd to display usage information on stderr and then exit.\n",
                    "flag": "-?",
                    "long": "--help"
                },
                {
                    "name": "-H, --ha-callout",
                    "content": "Specifies a high availability callout program.  If this option is  not  specified,  no\ncallouts are performed.  See the High-availability callouts section below for details.\n",
                    "flag": "-H",
                    "long": "--ha-callout"
                },
                {
                    "name": "-L --no-notify",
                    "content": "Prevents  rpc.statd  from  running the sm-notify command when it starts up, preserving\nthe existing NSM state number and monitor list.\n\nNote: the sm-notify command contains a check to ensure it runs only  once  after  each\nsystem reboot.  This prevents spurious reboot notification if rpc.statd restarts with‐\nout the -L option.\n",
                    "flag": "-L",
                    "long": "--no-notify"
                },
                {
                    "name": "-n, --name",
                    "content": "This string is only used by the sm-notify command as the source address from which  to\nsend reboot notification requests.\n\nThe  ipaddr  form  can be expressed as either an IPv4 or an IPv6 presentation address.\nIf this option is not specified, rpc.statd uses a wildcard address  as  the  transport\nbind address.  See sm-notify(8) for details.\n",
                    "flag": "-n",
                    "long": "--name"
                },
                {
                    "name": "-N",
                    "content": "command can also be run directly, this option is deprecated.\n",
                    "flag": "-N"
                },
                {
                    "name": "-o, --outgoing-port",
                    "content": "Specifies the source port number the sm-notify command should use when sending  reboot\nnotifications.  See sm-notify(8) for details.\n",
                    "flag": "-o",
                    "long": "--outgoing-port"
                },
                {
                    "name": "-p, --port",
                    "content": "Specifies the port number used for RPC listener sockets.  If this option is not speci‐\nfied, rpc.statd will try to consult /etc/services, if gets port succeed, set the  same\nport  for all listener socket, otherwise chooses a random ephemeral port for each lis‐\ntener socket.\n\nThis option can be used to fix the port value of its listeners when SMNOTIFY requests\nmust traverse a firewall between clients and servers.\n",
                    "flag": "-p",
                    "long": "--port"
                },
                {
                    "name": "-T, --nlm-port",
                    "content": "Specifies  the  port  number  that lockd should listen on for NLM requests.  This sets\nboth the TCP and UDP ports unless the UDP port is set separately.\n",
                    "flag": "-T",
                    "long": "--nlm-port"
                },
                {
                    "name": "-U, --nlm-udp-port",
                    "content": "Specifies the UDP port number that lockd should listen on for NLM requests.\n",
                    "flag": "-U",
                    "long": "--nlm-udp-port"
                },
                {
                    "name": "-P, --state-directory-path",
                    "content": "Specifies the pathname of the parent directory where NSM  state  information  resides.\nIf this option is not specified, rpc.statd uses /var/lib/nfs by default.\n\nAfter  starting,  rpc.statd attempts to set its effective UID and GID to the owner and\ngroup of the subdirectory sm of this directory.  After  changing  the  effective  ids,\nrpc.statd only needs to access files in sm and sm.bak within the state-directory-path.\n",
                    "flag": "-P",
                    "long": "--state-directory-path"
                },
                {
                    "name": "-v -V --version",
                    "content": "Causes rpc.statd to display version information on stderr and then exit.\n",
                    "flag": "-V",
                    "long": "--version"
                }
            ]
        },
        "CONFIGURATION FILE": {
            "content": "Many of the options that can be set on the command line can also be controlled through values\nset in the [statd] or, in some cases, the [lockd] sections of the /etc/nfs.conf configuration\nfile.   Values recognized in the [statd] section include port, outgoing-port, name, state-di‐‐\nrectory-path, and ha-callout which each have the same effect as  the  option  with  the  same\nname.\n\nThe  values  recognized  in the [lockd] section include port and udp-port which have the same\neffect as the --nlm-port and --nlm-udp-port options, respectively.\n\n",
            "subsections": []
        },
        "SECURITY": {
            "content": "The rpc.statd daemon must be started as root to acquire privileges needed to  create  sockets\nwith  privileged  source  ports,  and  to  access  the  state  information database.  Because\nrpc.statd maintains a long-running network service, however, it drops root privileges as soon\nas it starts up to reduce the risk of a privilege escalation attack.\n\nDuring  normal  operation,  the effective user ID it chooses is the owner of the state direc‐\ntory.  This allows it to continue to access files in that directory after it has dropped  its\nroot  privileges.  To control which user ID rpc.statd chooses, simply use chown(1) to set the\nowner of the state directory.\n\nYou can also protect your rpc.statd listeners using the tcpwrapper library  or  iptables(8).\nTo  use  the tcpwrapper library, add the hostnames of peers that should be allowed access to\n/etc/hosts.allow.  Use the daemon name statd even if the rpc.statd  binary  has  a  different\nfilename.\n\nFor further information see the tcpd(8) and hostsaccess(5) man pages.\n",
            "subsections": []
        },
        "ADDITIONAL NOTES": {
            "content": "Lock  recovery after a reboot is critical to maintaining data integrity and preventing unnec‐\nessary application hangs.  To help rpc.statd match SMNOTIFY requests to NLM requests, a num‐\nber of best practices should be observed, including:\n\nThe UTS nodename of your systems should match the DNS names that NFS peers use to con‐\ntact them\n\nThe UTS nodenames of your systems should always be fully qualified domain names\n\nThe forward and reverse DNS mapping of the UTS nodenames should be consistent\n\nThe hostname the client uses to mount the server should match the server's monname in\nSMNOTIFY requests it sends\n\nUnmounting  an NFS file system does not necessarily stop either the NFS client or server from\nmonitoring each other.  Both may continue monitoring each other for a time in case subsequent\nNFS traffic between the two results in fresh mounts and additional file locking.\n\nOn  Linux,  if  the  lockd  kernel module is unloaded during normal operation, all remote NFS\npeers are unmonitored.  This can happen on an NFS client, for example, if an automounter  re‐\nmoves all NFS mount points due to inactivity.\n",
            "subsections": [
                {
                    "name": "High-availability callouts",
                    "content": "rpc.statd  can  exec a special callout program during processing of successful SMMON, SMUN‐\nMON, and SMUNMONALL requests, or when it receives SMNOTIFY.  Such a program may be used in\nHigh  Availability NFS (HA-NFS) environments to track lock state that may need to be migrated\nafter a system reboot.\n\nThe name of the callout program is specified with the -H option.  The program is run  with  3\narguments: The first is either add-client del-client or sm-notify depending on the reason for\nthe callout.  The second is the monname of the monitored peer.  The third is the callername\nof  the  requesting lock manager for add-client or del-client , otherwise it is IPaddress of\nthe caller sending SMNOTIFY.  The forth is the statevalue in the SMNOTIFY request.\n\n"
                },
                {
                    "name": "IPv6 and TI-RPC support",
                    "content": "TI-RPC is a pre-requisite for supporting NFS on  IPv6.   If  TI-RPC  support  is  built  into\nrpc.statd, it attempts to start listeners on network transports marked 'visible' in /etc/net‐\nconfig.  As long as at least one network transport listener  starts  successfully,  rpc.statd\nwill operate.\n"
                }
            ]
        },
        "ENVIRONMENT": {
            "content": "RPCSTATDNONOTIFY=\nIf set to a positive integer, has the same effect as --no-notify.\n",
            "subsections": []
        },
        "FILES": {
            "content": "/var/lib/nfs/sm          directory containing monitor list\n\n/var/lib/nfs/sm.bak      directory containing notify list\n\n/var/lib/nfs/state       NSM state number for this host\n\n/run/run.statd.pid       pid file\n\n/etc/netconfig           network transport capability database\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "sm-notify(8), nfs(5), rpc.nfsd(8), rpcbind(8), tcpd(8), hostsaccess(5), iptables(8), netcon‐‐\nfig(5)\n\nRFC 1094 - \"NFS: Network File System Protocol Specification\"\nRFC 1813 - \"NFS Version 3 Protocol Specification\"\nOpenGroup Protocols for Interworking: XNFS, Version 3W - Chapter 11\n",
            "subsections": []
        },
        "AUTHORS": {
            "content": "Jeff Uphoff <juphoff@users.sourceforge.net>\nOlaf Kirch <okir@monad.swb.de>\nH.J. Lu <hjl@gnu.org>\nLon Hohberger <hohberger@missioncriticallinux.com>\nPaul Clements <paul.clements@steeleye.com>\nChuck Lever <chuck.lever@oracle.com>\n\n\n\n1 November 2009                              RPC.STATD(8)",
            "subsections": []
        }
    },
    "summary": "rpc.statd - NSM service daemon",
    "flags": [
        {
            "flag": "-d",
            "long": "--no-syslog",
            "arg": null,
            "description": "Causes rpc.statd to write log messages on stderr instead of to the system log, if the -F option was also specified."
        },
        {
            "flag": "-F",
            "long": "--foreground",
            "arg": null,
            "description": "Keeps rpc.statd attached to its controlling terminal so that NSM operation can be mon‐ itored directly or run under a debugger. If this option is not specified, rpc.statd backgrounds itself soon after it starts."
        },
        {
            "flag": "-?",
            "long": "--help",
            "arg": null,
            "description": "Causes rpc.statd to display usage information on stderr and then exit."
        },
        {
            "flag": "-H",
            "long": "--ha-callout",
            "arg": null,
            "description": "Specifies a high availability callout program. If this option is not specified, no callouts are performed. See the High-availability callouts section below for details."
        },
        {
            "flag": "-L",
            "long": "--no-notify",
            "arg": null,
            "description": "Prevents rpc.statd from running the sm-notify command when it starts up, preserving the existing NSM state number and monitor list. Note: the sm-notify command contains a check to ensure it runs only once after each system reboot. This prevents spurious reboot notification if rpc.statd restarts with‐ out the -L option."
        },
        {
            "flag": "-n",
            "long": "--name",
            "arg": null,
            "description": "This string is only used by the sm-notify command as the source address from which to send reboot notification requests. The ipaddr form can be expressed as either an IPv4 or an IPv6 presentation address. If this option is not specified, rpc.statd uses a wildcard address as the transport bind address. See sm-notify(8) for details."
        },
        {
            "flag": "-N",
            "long": null,
            "arg": null,
            "description": "command can also be run directly, this option is deprecated."
        },
        {
            "flag": "-o",
            "long": "--outgoing-port",
            "arg": null,
            "description": "Specifies the source port number the sm-notify command should use when sending reboot notifications. See sm-notify(8) for details."
        },
        {
            "flag": "-p",
            "long": "--port",
            "arg": null,
            "description": "Specifies the port number used for RPC listener sockets. If this option is not speci‐ fied, rpc.statd will try to consult /etc/services, if gets port succeed, set the same port for all listener socket, otherwise chooses a random ephemeral port for each lis‐ tener socket. This option can be used to fix the port value of its listeners when SMNOTIFY requests must traverse a firewall between clients and servers."
        },
        {
            "flag": "-T",
            "long": "--nlm-port",
            "arg": null,
            "description": "Specifies the port number that lockd should listen on for NLM requests. This sets both the TCP and UDP ports unless the UDP port is set separately."
        },
        {
            "flag": "-U",
            "long": "--nlm-udp-port",
            "arg": null,
            "description": "Specifies the UDP port number that lockd should listen on for NLM requests."
        },
        {
            "flag": "-P",
            "long": "--state-directory-path",
            "arg": null,
            "description": "Specifies the pathname of the parent directory where NSM state information resides. If this option is not specified, rpc.statd uses /var/lib/nfs by default. After starting, rpc.statd attempts to set its effective UID and GID to the owner and group of the subdirectory sm of this directory. After changing the effective ids, rpc.statd only needs to access files in sm and sm.bak within the state-directory-path."
        },
        {
            "flag": "-V",
            "long": "--version",
            "arg": null,
            "description": "Causes rpc.statd to display version information on stderr and then exit."
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "sm-notify",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/sm-notify/8/json"
        },
        {
            "name": "nfs",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/nfs/5/json"
        },
        {
            "name": "rpc.nfsd",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/rpc.nfsd/8/json"
        },
        {
            "name": "rpcbind",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/rpcbind/8/json"
        },
        {
            "name": "tcpd",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/tcpd/8/json"
        },
        {
            "name": "hostsaccess",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/hostsaccess/5/json"
        },
        {
            "name": "iptables",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/iptables/8/json"
        },
        {
            "name": "fig",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/fig/5/json"
        }
    ]
}