Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 29 Apr 2018 13:16:48 -0600
From:      Alan Somers <asomers@freebsd.org>
To:        Mark Raynsford <list+org.freebsd.net@io7m.com>
Cc:        FreeBSD Net <freebsd-net@freebsd.org>
Subject:   Re: Starting and stopping nfsd apparently results in permanently disabling it
Message-ID:  <CAOtMX2hi9y-HdQz1vDCTOSDjKT5hannHF_K64jJACjjC8T-avw@mail.gmail.com>
In-Reply-To: <20180429194958.53c7aa7d@almond.int.arc7.info>
References:  <20180429194958.53c7aa7d@almond.int.arc7.info>

next in thread | previous in thread | raw e-mail | index | archive | help
First, you're starting stuff in the wrong order.  /etc/rc.d/nfsd depends on
/etc/rc.d/mountd.  It sounds like you're bypassing rc, but you still need
to start the daemons in the same order as rc does.  Secondly, how did you
kill them?  /etc/rc.d/nfsd uses SIGUSR1 to kill nfsd.  That probably
triggers some special cleanup that didn't happen when you killed nfsd.

-Alan

On Sun, Apr 29, 2018 at 12:49 PM, Mark Raynsford via freebsd-net <
freebsd-net@freebsd.org> wrote:

> Hello.
>
> I've never used NFS, so this has been my first time setting it up. I
> ran the following:
>
> /usr/sbin/rpcbind -d -h 10.2.8.8 -s
> /usr/sbin/nfsd --debug -n 4 -t -h 10.2.8.8
> /usr/sbin/mountd -d -h 10.2.8.8 -l -p 9990 /local/etc/mountd/exports
>
> Note that I'm running the above under process supervision and therefore
> require that each server must be kept in the foreground rather than
> forking into the background where it can't be supervised. I had to use
> the undocumented --debug flag for nfsd to do this, but I don't think
> that's related to my problem.
>
> Anyway, I then realized that I actually meant to bind to 10.2.8.9
> instead, so I killed all of the above and then ran:
>
> /usr/sbin/rpcbind -d -h 10.2.8.9 -s
> /usr/sbin/nfsd --debug -n 4 -t -h 10.2.8.9
> /usr/sbin/mountd -d -h 10.2.8.9 -l -p 9990 /local/etc/mountd/exports
>
> Unfortunately, nfsd refused to start:
>
> nfsd[49031]: Can't read stable storage file: Operation not permitted
>
> Running ktrace on the nfsd process lead me to:
>
>  84873 nfsd     CALL  openat(AT_FDCWD,0x403b60,0x2<O_RDWR>)
>  84873 nfsd     NAMI  "/var/db/nfs-stablerestart"
>  84873 nfsd     RET   openat 3
>  84873 nfsd     CALL  fstat(0x3,0x7fffffffe940)
>  84873 nfsd     STRU  struct stat {dev=280827606, ino=66203, mode=0100600,
> nlink=1, uid=0, gid=0, rdev=4294967295, atime=1525025391.17
> 1870000, mtime=1525025391.171870000, ctime=1525025391.171870000,
> birthtime=1525025391.171870000, size=0, blksize=131072, blocks=1, fla
> gs=0x800 }
>  84873 nfsd     RET   fstat 0
>  84873 nfsd     CALL  openat(AT_FDCWD,0x403ece,0x2<O_RDWR>)
>  84873 nfsd     NAMI  "/var/db/nfs-stablerestart.bak"
>  84873 nfsd     RET   openat 4
>  84873 nfsd     CALL  fstat(0x4,0x7fffffffe9d0)
>  84873 nfsd     STRU  struct stat {dev=280827606, ino=66204, mode=0100600,
> nlink=1, uid=0, gid=0, rdev=4294967295, atime=1525025391.17
> 1956000, mtime=1525025391.171956000, ctime=1525025391.171956000,
> birthtime=1525025391.171956000, size=0, blksize=131072, blocks=1, fla
> gs=0x800 }
>  84873 nfsd     RET   fstat 0
>  84873 nfsd     CALL  nfssvc(NFSSVC_BACKUPSTABLE,0)
>  84873 nfsd     RET   nfssvc -1 errno 22 Invalid argument
>  84873 nfsd     CALL  nfssvc(NFSSVC_STABLERESTART,0x604590)
>  84873 nfsd     RET   nfssvc -1 errno 1 Operation not permitted
>
> Please see the trace files:
>
>   http://ataxia.io7m.com/2018/04/29/ktrace.out
>   http://ataxia.io7m.com/2018/04/29/ktrace.out.txt
>
> The /var/db/nfs-stablerestart and /var/db/nfs-stablerestart.bak files
> are empty, root:wheel, and mode 600. Nothing I can do can seem to get
> nfsd to come back up. It seems to be permanently disabled somehow and
> always gives the same error.
>
> How can I fix this?
>
> --
> Mark Raynsford | http://www.io7m.com
>
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAOtMX2hi9y-HdQz1vDCTOSDjKT5hannHF_K64jJACjjC8T-avw>