1sm-notify(8) System Manager's Manual sm-notify(8)
2
3
4
6 sm-notify - Send out NSM reboot notifications
7
9 /sbin/sm-notify [-dfq] [-m time] [-p port] [-P path] [-v my_name ]
10
12 File locking over NFS (v2 and v3) requires a facility to notify peers
13 in case of a reboot, so that clients can reclaim locks after a server
14 crash, and/or servers can release locks held by the rebooted client.
15
16 This is a two-step process: during normal operations, a mechanism is
17 required to keep track of which hosts need to be informed of a reboot.
18 And of course, notifications need to be sent out during reboot. The
19 protocol used for this is called NSM, for Network Status Monitor.
20
21 This implementation separates these into separate program. rpc.statd
22 tracks hosts which need to be notified and this sm-notify performs the
23 notification. When rpc.statd is started it will typically started sm-
24 notify but this is configurable.
25
26 Operation
27 For each NFS client or server machine to be monitored, rpc.statd cre‐
28 ates a file in /var/lib/nfs/statd/sm, and removes the file if monitor‐
29 ing is no longer required.
30
31 When the machine is rebooted, sm-notify iterates through these files
32 and notifies the peer statd server on those machines.
33
34 Each machine has an NSM state , which is basically an integer counter
35 that is incremented each time the machine reboots. This counter is
36 stored in /var/lib/nfs/statd/state, and updated by sm-notify.
37
38 Security
39 sm-notify has little need for root privileges and so drops them as soon
40 as possible. It continues to need to make changes to the sm and sm.bak
41 directories so to be able to drop privileges, these must be writable by
42 a non-privileged user. If these directories are owned by a non-root
43 user, sm-notify will drop privilege to match that user once it has cre‐
44 ated sockets for sending out request (for which it needs privileged)
45 but before it processes any reply (which is the most likely source of
46 possible privilege abuse).
47
49 -m failtime
50 When notifying hosts, sm-notify will try to contact each host
51 for up to 15 minutes, and will give up if unable to reach it
52 within this time frame.
53
54 Using the -m option, you can override this. A value of 0 tells
55 sm-notify to retry indefinitely; any other value is interpreted
56 as the maximum retry time in minutes.
57
58 -v ipaddr-or-hostname
59 This option tells sm-notify to bind to the specified ipaddr, (or
60 the ipaddr of the given hostname) so that all notification pack‐
61 ets originate from this address. This is useful for NFS
62 failover. The given name is also used as the name of this host
63 in the NSM request.
64
65 -p port
66 instructs sm-notify to bind to the indicated IP port number. If
67 this option is not given, it will try to bind to a randomly cho‐
68 sen privileged port below 1024.
69
70 -q Be quiet. This suppresses all messages except error messages
71 while collecting the list of hosts.
72
73 -P /path/to/state/directory
74 If sm-notify should look in a no-standard place of state file,
75 the path can be given here. The directories sm and sm.bak and
76 the file state must exist in that directory with the standard
77 names.
78
79 -f If the state path has not been reset with -P, sm-notify will
80 normally create a file in /var/run to indicate that it has been
81 run. If this file is found when sm-notify starts, it will not
82 run again (as it is normally only needed once per reboot). If
83 -f (for force) is given, sm-notify will run even if the file in
84 /var/run is present.
85
86 -n Do not update the NSM state. This is for testing only. Setting
87 this flag implies -f.
88
89 -d Enables debugging. By default, sm-notify forks and puts itself
90 in the background after obtaining the list of hosts from
91 /var/lib/nfs/statd/sm.
92
94 /var/lib/nfs/statd/state
95 /var/lib/nfs/statd/sm/*
96 /var/lib/nfs/statd/sm.bak/*
97 /var/run/sm-notify.pid
98
100 rpc.nfsd(8), portmap(8)
101
103 Olaf Kirch <okir@suse.de>
104
105
106
107 19 Mar 2007 sm-notify(8)