At least on Beowulf (I didn't check for older releases) network filesystems are apparently mounted via /etc/network/if-up.d/mountnfs
. For debugging I added a set -x
and redirected the script output to a log file. After taking the network interface down and back up, I found a curious error message in the debug log:
42: /etc/init.d/rpcbind: stat: not found
mountnfs
does attempt to start both portmap
and rpcbind
, and line 42 in the rpcbind
init script simply checks owner, permissions and filetype of the service's state directory (/run/rpcbind
):
if [ "$(LC_ALL=C stat -c '%U %g %a %F' "$STATEDIR")" != "_rpc 0 755 directory" ] ; then
which should work (and did so when I manually ran the command). However, the command is called without a path, and it's not a shell builtin, but a binary located in /usr/bin
. Which reeks of a PATH
issue. And sure enough, when I changed the command to full path, everything started working again:
if [ "$(LC_ALL=C /usr/bin/stat -c '%U %g %a %F' "$STATEDIR")" != "_rpc 0 755 directory" ] ; then
The root cause of the issue seems to be that /etc/network/if-up.d/mountnfs
sets PATH=/sbin:/bin
, while /etc/init.d/rpcbind
apparently expects a less restrictive PATH
, but doesn't bother ensuring that.