/etc/init.d/nfs restart removes current exports (exportfs -ua) although that's exactly what's not supposed to happen according to the comments in the file. The offending line is: /etc/init.d/nfs:134: if [ "${restarting}" = no -o "${RC_CMD}" = "restart" ] ; then which should probably read if [ "${restarting}" = no -a "${RC_CMD}" != "restart" ] ; then Steps to reproduce: 1. /etc/init.d/nfs start 2. /etc/init.d/nfs restart 3. Observe this line appearing in the output: * Unexporting NFS directories ... [ ok ]
Looks like this goes all the way back to 2007: https://gitweb.gentoo.org/repo/gentoo/historical.git/commit/net-fs/nfs-utils/files/nfs.initd?id=a0fefa89daef53b895acfbd6540a63cc1569025b
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=998148dd775a5c629266fcd1c93837ac8ee3541d commit 998148dd775a5c629266fcd1c93837ac8ee3541d Author: Matt Turner <mattst88@gentoo.org> AuthorDate: 2019-09-02 05:50:16 +0000 Commit: Matt Turner <mattst88@gentoo.org> CommitDate: 2019-09-02 07:08:13 +0000 net-fs/nfs-utils: Don't unexport directories on restart Originally added in 2007 (see commit a0fefa89daef "Remove some bashisms and support baselayout-2 restart option." in the historical repo), = vs != looks like an obvious typo. But, with RC_CMD, we don't need the extra restarting variable. Closes: https://bugs.gentoo.org/675644 Signed-off-by: Matt Turner <mattst88@gentoo.org> net-fs/nfs-utils/files/nfs.initd | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)