|
root / base / usr / src / zyginit / services / nfs-lockd / start.sh
start.sh Bash 23 lines 727 B
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/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