From owner-freebsd-net@freebsd.org Sun Apr 29 19:16:52 2018 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3839FB5A42 for ; Sun, 29 Apr 2018 19:16:51 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lf0-x229.google.com (mail-lf0-x229.google.com [IPv6:2a00:1450:4010:c07::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 40D6279CCE for ; Sun, 29 Apr 2018 19:16:51 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lf0-x229.google.com with SMTP id j16-v6so9464673lfb.7 for ; Sun, 29 Apr 2018 12:16:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=zZetaUP587oo0zDdjCSgQRUUZFd0HWxP1M10ZfrlKoI=; b=T9h3lsexpO3V+dM8JgJpC9EiA5dXNU/UDy7miBozZSLG0hdQWh0OECeNEjGu2UipKt wPBMsd4ILtFc3XYJ28JEWfvgPmeqIL/IbmY/JL4xV2/w+cMcvNi9oRYfxAXX1uAJ00r/ fm+nPmWzBj8++sZsZMYCH8P4r/qzRvl8nDnSMHvqq0gRlweedXMT2IROEcyEOm6/TAa5 DBjydXaA54GI6Tf8/xCU3J/PqE9avwDTBuRFkVqhA1Ju/N5An8OSXZnIwgZhrU0OMcxL ZWz9HBgowCrnVRgIrNYgDJRqPJ4B9LCbe/pUZXAck8YS1lvbtdps0sb5O0XXtJkmorBJ Ltow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=zZetaUP587oo0zDdjCSgQRUUZFd0HWxP1M10ZfrlKoI=; b=lp6mK4mOlMqGMZh5n793vWh+J28yjLyl6ELf6X1mnjHyg01SpAMup7hFcTZ/Z6Nv0X czY3XcA6nC2LJgtSB+Zd+cv9xX6UNcaA6nVXWVswcrB2CYfwhgUzYi0hjzo2QLczrJ0S Djmeshi2Wjib/s+RXOHh8Jwp3e37TDziMCqttazL1uOrDP3AoMmxOYFM4nga7+7sn1Q2 U0/04ChqbnCxKoN70tj8nmZs9/l7pVRYNx8e3j9UF6ZTeKBh2TmU0VwO7aCdA1uSqJpw wV6rFedtoaE5Ra/jkWhHtBu4Ter23ABX5s/s1FF932JxHAXbIEcVFVzXtRLJdKwyScj6 VaEQ== X-Gm-Message-State: ALQs6tA8cw0UNGZDG/rBHiZvWZlraIn67Tq5lxRTYWbbiLqbbJnmkKyj 8DY18ZByfoOop/koSraunWco+ueQ+fGusduW3BE= X-Google-Smtp-Source: AB8JxZon7tXd3gDZeG0eY1h7GNikxY1dNT60Ojx3uBJ3eVT7eenHBaMZ7Igx+ZnG3edNzBiB1yBx7dEYVlevBu3kxLU= X-Received: by 2002:a2e:4949:: with SMTP id b9-v6mr1655805ljd.116.1525029409392; Sun, 29 Apr 2018 12:16:49 -0700 (PDT) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.179.114.79 with HTTP; Sun, 29 Apr 2018 12:16:48 -0700 (PDT) In-Reply-To: <20180429194958.53c7aa7d@almond.int.arc7.info> References: <20180429194958.53c7aa7d@almond.int.arc7.info> From: Alan Somers Date: Sun, 29 Apr 2018 13:16:48 -0600 X-Google-Sender-Auth: gjgL0u8Lineejf-mBmh4DBSscuk Message-ID: Subject: Re: Starting and stopping nfsd apparently results in permanently disabling it To: Mark Raynsford Cc: FreeBSD Net Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Apr 2018 19:16:52 -0000 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) > 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) > 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 > >