From owner-freebsd-rc@FreeBSD.ORG Mon Oct 31 19:23:49 2011 Return-Path: Delivered-To: rc@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D60E6106564A for ; Mon, 31 Oct 2011 19:23:49 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id 97E0C8FC15 for ; Mon, 31 Oct 2011 19:23:46 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:55a7:a9f1:1d0f:91f9] (unknown [IPv6:2001:7b8:3a7:0:55a7:a9f1:1d0f:91f9]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 7F9FC5C37 for ; Mon, 31 Oct 2011 20:23:44 +0100 (CET) Message-ID: <4EAEF5BE.7060406@FreeBSD.org> Date: Mon, 31 Oct 2011 20:23:42 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111019 Thunderbird/8.0 MIME-Version: 1.0 To: rc@FreeBSD.org Content-Type: multipart/mixed; boundary="------------070507030101080807010708" X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Subject: An issue with nfsv4_server_enable=YES and /etc/rc.d/nfsd X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Oct 2011 19:23:49 -0000 This is a multi-part message in MIME format. --------------070507030101080807010708 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi, I recently experimented a bit with enabling NFSv4 on one of my -current boxes. While it worked fine eventually, I ran into a little snag: Whenever you boot up your machine with nfsv4_server_enable=NO in rc.conf, the /etc/rc.d/nfsd script sets vfs.nfsd.server_max_nfsvers to 3. Then, when you set nfsv4_server_enable=YES, and restart nfsd via the rc.d script, the sysctl does *not* get reset to max version 4, so NFSv4 still doesn't work! Obviously, if you just reboot the machine, it will get reset to its default value of 4 again, but it should not really be needed, just to change this setting, right? So I propose the attached patch, which resets server_max_nfsvers to 4, whenever you set nfsv4_server_enable=YES in rc.conf. I also added resetting of the nfs_privport sysctls, since this has the same issue: nfs_reserved_port_only=YES sets the nfs_privport sysctl to 1, but in the other case, the sysctl doesn't get reset to 0. Is this OK to commit? Would also be nice to have in 9.0, I think. P.S.: This looked good to rmacklem@. --------------070507030101080807010708--