#!/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=0while ! /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 1doneexec /usr/lib/nfs/lockd