{
    "mode": "man",
    "parameter": "sm-notify",
    "section": "8",
    "url": "https://www.chedong.com/phpMan.php/man/sm-notify/8/json",
    "generated": "2026-05-30T15:36:42Z",
    "synopsis": "/usr/sbin/sm-notify [-dfn] [-m minutes] [-v name] [-p notify-port] [-P path]",
    "sections": {
        "NAME": {
            "content": "sm-notify - send reboot notifications to NFS peers\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "/usr/sbin/sm-notify [-dfn] [-m minutes] [-v name] [-p notify-port] [-P path]\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 and version 3, the Network Status Monitor protocol (or NSM for short) is\nused to notify NFS peers of reboots.  On Linux, two separate user-space components constitute\nthe NSM service:\n",
            "subsections": [
                {
                    "name": "sm-notify",
                    "content": "A helper program that notifies NFS peers after the local system reboots\n"
                },
                {
                    "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\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 records the server's hostname\nused on the 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 normally sends myname string recorded when that remote was  monitored.\nThe  remote  rpc.statd matches incoming SMNOTIFY requests using this string, or the caller's\nnetwork 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",
                    "content": "that notification progress may be monitored directly.\n",
                    "flag": "-d"
                },
                {
                    "name": "-f",
                    "content": "",
                    "flag": "-f"
                },
                {
                    "name": "-m",
                    "content": "Specifies the length of time, in minutes, to continue retrying notifications to  unre‐\nsponsive hosts.  If this option is not specified, sm-notify attempts to send notifica‐\ntions for 15 minutes.  Specifying a value of 0 causes sm-notify  to  continue  sending\nnotifications to unresponsive peers until it is manually killed.\n\nNotifications  are retried if sending fails, the remote does not respond, the remote's\nNSM service is not registered, or if there is a DNS failure  which  prevents  the  re‐\nmote's monname from being resolved to an address.\n\nHosts  are  not  removed  from  the notification list until a valid reply has been re‐\nceived.  However, the SMNOTIFY procedure has a void result.  There is no way for  sm-\nnotify  to  tell  if the remote recognized the sender and has started appropriate lock\nrecovery.\n",
                    "flag": "-m"
                },
                {
                    "name": "-n",
                    "content": "",
                    "flag": "-n"
                },
                {
                    "name": "-p",
                    "content": "Specifies the source port number sm-notify should use when  sending  reboot  notifica‐\ntions.  If this option is not specified, a randomly chosen ephemeral port is used.\n\nThis option can be used to traverse a firewall between client and server.\n",
                    "flag": "-p"
                },
                {
                    "name": "-P, --state-directory-path",
                    "content": "Specifies  the  pathname  of the parent directory where NSM state information resides.\nIf this option is not specified, sm-notify uses /var/lib/nfs by default.\n\nAfter starting, sm-notify 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, sm-\nnotify only needs to access files in sm and sm.bak within the state-directory-path.\n",
                    "flag": "-P",
                    "long": "--state-directory-path"
                },
                {
                    "name": "-v",
                    "content": "Specifies the network address  from  which  to  send  reboot  notifications,  and  the\nmonname argument to use when sending SMNOTIFY requests.  If this option is not spec‐\nified, sm-notify uses a wildcard address as the transport bind address, and  uses  the\nmyname  recorded  when the remote was monitored as the monname argument when sending\nSMNOTIFY requests.\n\nThe ipaddr form can be expressed as either an IPv4 or an  IPv6  presentation  address.\nIf  the ipaddr form is used, the sm-notify command converts this address to a hostname\nfor use as the monname argument when sending SMNOTIFY requests.\n\nThis option can be useful in multi-homed configurations where the remote requires  no‐\ntification from a specific network address.\n",
                    "flag": "-v"
                }
            ]
        },
        "CONFIGURATION FILE": {
            "content": "Many of the options that can be set on the command line can also be controlled through values\nset in the [sm-notify] or, in one case, the [statd] section of the  /etc/nfs.conf  configura‐\ntion file.\n\nValues  recognized  in the [sm-notify] section include: retry-time, outgoing-port, and outgo‐‐\ning-addr.  These have the same effect as the command line options m, p, and v respectively.\n\nAn additional value recognized in the [sm-notify] section is lift-grace.  By default,  sm-no‐‐\ntify will lift lockd's grace period early if it has no hosts to notify.  Some high availabil‐\nity configurations will run one sm-notify per floating IP address.  In these  configurations,\nlifting the grace period early may prevent clients from reclaiming locks.  Setting lift-grace\nto n will prevent sm-notify from ending the grace period early.   lift-grace  has  no  corre‐\nsponding command line option.\n\nThe value recognized in the [statd] section is state-directory-path.\n\n",
            "subsections": []
        },
        "SECURITY": {
            "content": "The  sm-notify  command  must  be  started as root to acquire privileges needed to access the\nstate information database.  It drops root privileges as soon as it starts up to  reduce  the\nrisk 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",
            "subsections": []
        },
        "ADDITIONAL NOTES": {
            "content": "Lock recovery after a reboot is critical to maintaining data integrity and preventing  unnec‐\nessary application hangs.\n\nTo help rpc.statd match SMNOTIFY requests to NLM requests, a number of best practices should\nbe 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": "IPv6 and TI-RPC support",
                    "content": "TI-RPC is a pre-requisite for supporting NFS on IPv6.  If TI-RPC support is  built  into  the\nsm-notify  command ,it will choose an appropriate IPv4 or IPv6 transport based on the network\naddress returned by DNS for each remote peer.  It should be fully compatible with remote sys‐\ntems that do not support TI-RPC or IPv6.\n\nCurrently,  the  sm-notify  command supports sending notification only via datagram transport\nprotocols.\n"
                }
            ]
        },
        "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/proc/sys/fs/nfs/nsmlocalstate\nkernel's copy of the NSM state number\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "rpc.statd(8), nfs(5), uname(2), hostname(7)\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": "Olaf Kirch <okir@suse.de>\nChuck Lever <chuck.lever@oracle.com>\n\n\n\n1 November 2009                              SM-NOTIFY(8)",
            "subsections": []
        }
    },
    "summary": "sm-notify - send reboot notifications to NFS peers",
    "flags": [
        {
            "flag": "-d",
            "long": null,
            "arg": null,
            "description": "that notification progress may be monitored directly."
        },
        {
            "flag": "-f",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-m",
            "long": null,
            "arg": null,
            "description": "Specifies the length of time, in minutes, to continue retrying notifications to unre‐ sponsive hosts. If this option is not specified, sm-notify attempts to send notifica‐ tions for 15 minutes. Specifying a value of 0 causes sm-notify to continue sending notifications to unresponsive peers until it is manually killed. Notifications are retried if sending fails, the remote does not respond, the remote's NSM service is not registered, or if there is a DNS failure which prevents the re‐ mote's monname from being resolved to an address. Hosts are not removed from the notification list until a valid reply has been re‐ ceived. However, the SMNOTIFY procedure has a void result. There is no way for sm- notify to tell if the remote recognized the sender and has started appropriate lock recovery."
        },
        {
            "flag": "-n",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-p",
            "long": null,
            "arg": null,
            "description": "Specifies the source port number sm-notify should use when sending reboot notifica‐ tions. If this option is not specified, a randomly chosen ephemeral port is used. This option can be used to traverse a firewall between client and server."
        },
        {
            "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, sm-notify uses /var/lib/nfs by default. After starting, sm-notify 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, sm- notify only needs to access files in sm and sm.bak within the state-directory-path."
        },
        {
            "flag": "-v",
            "long": null,
            "arg": null,
            "description": "Specifies the network address from which to send reboot notifications, and the monname argument to use when sending SMNOTIFY requests. If this option is not spec‐ ified, sm-notify uses a wildcard address as the transport bind address, and uses the myname recorded when the remote was monitored as the monname argument when sending SMNOTIFY requests. The ipaddr form can be expressed as either an IPv4 or an IPv6 presentation address. If the ipaddr form is used, the sm-notify command converts this address to a hostname for use as the monname argument when sending SMNOTIFY requests. This option can be useful in multi-homed configurations where the remote requires no‐ tification from a specific network address."
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "rpc.statd",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/rpc.statd/8/json"
        },
        {
            "name": "nfs",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/nfs/5/json"
        },
        {
            "name": "uname",
            "section": "2",
            "url": "https://www.chedong.com/phpMan.php/man/uname/2/json"
        },
        {
            "name": "hostname",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/hostname/7/json"
        }
    ]
}