NFSDv4 supports client tracking across server restarts using two
methods. The legacy method is in-kernel and requires CONFIG_CRYPTO_MD5,
which is not automatically selected by CONFIG_NFSD_V4 (see
https://bugzilla.kernel.org/show_bug.cgi?id=52271). The newer method
involves a usermode helper upcall program (nfsdcltrack), which is built
and installed only when USE="nfsdcld". If neither method is available,
then the NFS server does not support tracking clients across restarts,
and it emits a warning to the kernel log:
NFSD: unable to generate recoverydir name (-2).
NFSD: disabling legacy clientid tracking. Reboot recovery will not function correctly!
This commit introduces an ewarn in pkg_setup to warn the user if their
configuration will not support client tracking due to neither of these
options being enabled.
Closes: https://github.com/gentoo/gentoo/pull/1448
Closes: https://bugs.gentoo.org/582714
Signed-off-by: Matt Turner <mattst88@gentoo.org>
EAPI=7
-inherit autotools flag-o-matic multilib systemd
+inherit autotools flag-o-matic linux-info multilib systemd
DESCRIPTION="NFS client and server daemons"
HOMEPAGE="http://linux-nfs.org/"
"${FILESDIR}"/${P}-gssd-Look-in-lib32-for-gss-libs-aswell.patch
)
+pkg_setup() {
+ linux-info_pkg_setup
+ if use nfsv4 && ! use nfsdcld && linux_config_exists && ! linux_chkconfig_present CRYPTO_MD5 ; then
+ ewarn "Your NFS server will be unable to track clients across server restarts!"
+ ewarn "Please enable the \"${HILITE}nfsdcld${NORMAL}\" USE flag to install the nfsdcltrack usermode"
+ ewarn "helper upcall program, or enable ${HILITE}CONFIG_CRYPTO_MD5${NORMAL} in your kernel to"
+ ewarn "support the legacy, in-kernel client tracker."
+ fi
+}
+
src_prepare() {
default