# NFS lock manager (RPC program 100021). Implements NLM v3 locking; # both client and server need it. Must wait for statd to register # before lockd can attach to it. # Replaces /lib/svc/manifest/network/nfs/nlockmgr.xml. [service] name = "nfs-lockd" description = "NFS lock manager (lockd)" type = "daemon" [exec] start = "/etc/zyginit/services/nfs-lockd/start.sh" [dependencies] requires = ["rpcbind", "nfs-statd"] [restart] on = "failure" delay = 5 max_retries = 3 [contract] param = ["inherit", "noorphan"] fatal = ["hwerr"] #!/bin/sh # Wait until statd has registered an RPC address. The kernel's NLM # code expects to find statd at attach time; without this wait, # lockd can fail noisily on first call. # # Use absolute paths for every command — first-boot-of-fresh-deploy can # transiently fail bare-command lookups under I/O pressure. See # [[zyginit-service-empty-path]] and the swap/start.sh precedent # (commit 87e9f19f69). PATH= kept as defense-in-depth. PATH=/usr/sbin:/usr/bin:/sbin:/bin export PATH i=0 while ! /usr/bin/rpcinfo -T tcp 127.0.0.1 status >/dev/null 2>&1; do i=$((i + 1)) [ $i -gt 30 ] && { /bin/echo "statd never registered after 30s" >&2 exit 1 } /bin/sleep 1 done exec /usr/lib/nfs/lockd