NetBSD Problem Report #51437

From hf@spg.tu-darmstadt.de  Mon Aug 22 14:00:36 2016
Return-Path: <hf@spg.tu-darmstadt.de>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 1F07F7A218
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 22 Aug 2016 14:00:36 +0000 (UTC)
Message-Id: <201608221400.u7ME0TnM000352@Hochstuhl.nt.e-technik.tu-darmstadt.de>
Date: Mon, 22 Aug 2016 16:00:29 +0200 (CEST)
From: Hauke Fath <hf@spg.tu-darmstadt.de>
Reply-To: Hauke Fath <hf@spg.tu-darmstadt.de>
To: gnats-bugs@NetBSD.org
Cc: Hauke Fath <hf@spg.tu-darmstadt.de>
Subject: 'nfsd -u' terminates quietly
X-Send-Pr-Version: 3.95

>Number:         51437
>Category:       bin
>Synopsis:       'nfsd -u' terminates quietly
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          needs-pullups
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Aug 22 14:05:00 +0000 2016
>Closed-Date:    
>Last-Modified:  Tue Jun 19 23:41:48 +0000 2018
>Originator:     Hauke Fath
>Release:        NetBSD 7.0_STABLE
>Organization:
Technische Universitaet Darmstadt
>Environment:


System: NetBSD Hochstuhl 7.0_STABLE NetBSD 7.0_STABLE (MONOLITHIC) #1: Mon Aug 22 14:49:23 CEST 2016 hf@Hochstuhl:/var/obj/netbsd-builds/7/amd64/sys/arch/amd64/compile/MONOLITHIC amd64
Architecture: x86_64
Machine: amd64
>Description:

	An udp-only nfsd instance, started as '/usr/sbin/nfsd -u',
	will terminate immediately with return value 1, but no other
	disgnostics.

	The man page says this should work.

	The problem showed up after reconfiguring a 2016-04
	installation, and persisted after updating to a netbsd-7 head
	build.

	The output of a 'ktrace -di /usr/sbin/nfsd -u' didn't speak to
	me.



>How-To-Repeat:


[Set up /etc/exports, run rpcbind and mountd, etc.]

# /usr/sbin/nfsd -u || echo $status
1
# /usr/sbin/nfsd || echo $status
# pgrep nfsd
695
#

>Fix:

	Yes, please.

>Release-Note:

>Audit-Trail:
From: "Christos Zoulas" <christos@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/51437 CVS commit: src/usr.sbin/nfsd
Date: Mon, 22 Aug 2016 12:08:51 -0400

 Module Name:	src
 Committed By:	christos
 Date:		Mon Aug 22 16:08:51 UTC 2016

 Modified Files:
 	src/usr.sbin/nfsd: nfsd.c

 Log Message:
 PR/51437: Hauke Fath: write a byte to the socket so that nfsd -u does not die.


 To generate a diff of this commit:
 cvs rdiff -u -r1.66 -r1.67 src/usr.sbin/nfsd/nfsd.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: Hauke Fath <hf@spg.tu-darmstadt.de>
To: gnats-bugs@NetBSD.org
Cc: gnats-admin@NetBSD.org, Christos Zoulas <christos@NetBSD.org>
Subject: Re: PR/51437 CVS commit: src/usr.sbin/nfsd
Date: Tue, 23 Aug 2016 12:18:26 +0200

 On 08/22/16 18:10, Christos Zoulas wrote:
 >  Modified Files:
 >  	src/usr.sbin/nfsd: nfsd.c

 Thanks, that was quick!

 I applied the following to netbsd-7:


 Index: nfsd.c
 ===================================================================
 RCS file: /cvsroot/src/usr.sbin/nfsd/nfsd.c,v
 retrieving revision 1.62.4.1
 diff -u -u -r1.62.4.1 nfsd.c
 --- nfsd.c      14 Apr 2015 05:14:17 -0000      1.62.4.1
 +++ nfsd.c      23 Aug 2016 10:13:26 -0000
 @@ -301,6 +301,7 @@
           case 0:
                   /* child */
                   (void)close(detach_msg_pipe[0]);
 +                (void)write(detach_msg_pipe[1], "", 1);
                   return detach_msg_pipe[1];
           default:
                   break;
 @@ -468,6 +469,8 @@

          if (debug == 0) {
                  parent_fd = daemon2_fork();
 +               if (parent_fd == -1)
 +                       syslog(LOG_ERR, "daemon2_fork failed");
          }

          openlog("nfsd", LOG_PID, LOG_DAEMON);


 Alternatively, we could just pull up the -current state to -7?

 Cheerio,
 Hauke

From: christos@zoulas.com (Christos Zoulas)
To: Hauke Fath <hf@spg.tu-darmstadt.de>, gnats-bugs@NetBSD.org
Cc: gnats-admin@NetBSD.org
Subject: Re: PR/51437 CVS commit: src/usr.sbin/nfsd
Date: Tue, 23 Aug 2016 06:46:27 -0400

 On Aug 23, 12:18pm, hf@spg.tu-darmstadt.de (Hauke Fath) wrote:
 -- Subject: Re: PR/51437 CVS commit: src/usr.sbin/nfsd

 | On 08/22/16 18:10, Christos Zoulas wrote:
 | >  Modified Files:
 | >  	src/usr.sbin/nfsd: nfsd.c
 | 
 | Thanks, that was quick!
 | 
 | I applied the following to netbsd-7:
 | 
 | Alternatively, we could just pull up the -current state to -7?

 Let's just apply the patch for now!

 christos

From: Hauke Fath <hf@spg.tu-darmstadt.de>
To: gnats-bugs@NetBSD.org
Cc: gnats-admin@NetBSD.org
Subject: Re: PR/51437 CVS commit: src/usr.sbin/nfsd
Date: Tue, 23 Aug 2016 13:51:24 +0200

 On Tue, 23 Aug 2016 10:20:01 +0000 (UTC), Hauke Fath wrote:
 >  Thanks, that was quick!

 I spoke too soon; all that has changed is 'nfsd -u' now returns even 
 more quietly:

 # /usr/sbin/nfsd -u
 # echo $status
 0
 # pgrep nfsd
 #

From: christos@zoulas.com (Christos Zoulas)
To: Hauke Fath <hf@spg.tu-darmstadt.de>, gnats-bugs@NetBSD.org
Cc: gnats-admin@NetBSD.org
Subject: Re: PR/51437 CVS commit: src/usr.sbin/nfsd
Date: Tue, 23 Aug 2016 08:39:27 -0400

 On Aug 23,  1:51pm, hf@spg.tu-darmstadt.de (Hauke Fath) wrote:
 -- Subject: Re: PR/51437 CVS commit: src/usr.sbin/nfsd

 | On Tue, 23 Aug 2016 10:20:01 +0000 (UTC), Hauke Fath wrote:
 | >  Thanks, that was quick!
 | 
 | I spoke too soon; all that has changed is 'nfsd -u' now returns even 
 | more quietly:
 | 
 | # /usr/sbin/nfsd -u
 | # echo $status
 | 0
 | # pgrep nfsd

 Yes, this is what it did for 6.0... Perhaps the kernel is behaving
 differently now?

 christos

State-Changed-From-To: open->needs-pullups
State-Changed-By: maya@NetBSD.org
State-Changed-When: Tue, 19 Jun 2018 23:41:48 +0000
State-Changed-Why:
Correct status. (it is in netbsd-8 by age, but not in netbsd-7/6).


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.