From nobody@FreeBSD.org  Fri Dec 29 12:11:24 2006
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id A872116A403
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 29 Dec 2006 12:11:24 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [69.147.83.33])
	by mx1.freebsd.org (Postfix) with ESMTP id 9922A13C47E
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 29 Dec 2006 12:11:24 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id kBTCBOuO098501
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 29 Dec 2006 12:11:24 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id kBTCBOdO098500;
	Fri, 29 Dec 2006 12:11:24 GMT
	(envelope-from nobody)
Message-Id: <200612291211.kBTCBOdO098500@www.freebsd.org>
Date: Fri, 29 Dec 2006 12:11:24 GMT
From: Jonathan Liu<Net147@hotmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [rpc.lockd] nfslocking restart does not restart rpc.lockd
X-Send-Pr-Version: www-3.0

>Number:         107316
>Category:       conf
>Synopsis:       [rc.d]: [base] [rpc.lockd] nfslocking restart does not restart rpc.lockd
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    mtm
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Dec 29 12:20:11 GMT 2006
>Closed-Date:    Wed Sep 26 11:11:34 GMT 2007
>Last-Modified:  Wed Sep 26 11:11:34 GMT 2007
>Originator:     Jonathan Liu
>Release:        6.1-SECURITY
>Organization:
>Environment:
FreeBSD freebsd 6.1-SECURITY FreeBSD 6.1-SECURITY #0: Mon Aug 28 05:36:36 UTC 2006     root@builder.daemonology.net:/usr/obj/usr/src/sys/SMP  i386
>Description:
# /etc/rc.d/nfslocking restart
Stopping statd.
Starting statd.

As you can see, restarting nfslocking does only restarts statd when it should restart lockd as well.

This can unexpectedly stop the NFS file locking daemon from working when NFS clients try to use it. This is clearly evident from the output of "rpcbind -p" which doesn't show nlockmgr listed after the restart is complete.
>How-To-Repeat:
# /etc/rc.d/nfslocking restart
>Fix:
Workaround for the moment:
# /etc/rc.d/nfslocking stop
Stopping statd.
Stopping lockd.
# /etc/rc.d/nfslocking start
Starting statd.
Starting lockd.
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-rc 
Responsible-Changed-By: remko 
Responsible-Changed-When: Fri Dec 29 15:34:30 UTC 2006 
Responsible-Changed-Why:  
Assign to the rc team. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=107316 

From: Ceri Davies <ceri@submonkey.net>
To: FreeBSD Gnats Submit <freebsd-gnats-submit@FreeBSD.org>
Cc: freebsd-rc@FreeBSD.org, Remko Lodder <remko@FreeBSD.org>
Subject: Re: conf/107316: [rc.d]: [base] [rpc.lockd] nfslocking restart does not restart rpc.lockd
Date: Sat, 30 Dec 2006 12:48:03 +0000

 Restarting twice from the same script is explicitly denied in
 /etc/rc.subr:
 
  783                                         # prevent restart being called more
  784                                         # than once by any given script
  785                                         #
  786                         if ${_rc_restart_done:-false}; then
  787                                 return 0
  788                         fi
  789                         _rc_restart_done=true
 
 This is why it's failing to restart rpc.lockd, but I don't know why that
 check is there.
 
 Ceri
 -- 
 That must be wonderful!  I don't understand it at all.
                                                   -- Moliere

From: Mike Makonnen <mtm@FreeBSD.Org>
To: Net147@hotmail.com
Cc: bug-followup@FreeBSD.org
Subject: Re: conf/107316: [rc.d]: [base] [rpc.lockd] nfslocking restart does
	 not restart rpc.lockd
Date: Thu, 17 May 2007 14:12:07 +0300

 I believe _rc_restart_done is there to prevent uncontrollable
 recursion (for example, script A runs script B, which runs script C,
 which runs script A).
 
 I think the solution is to break out rc.d/nfslocking into rc.d/statd and
 rc.d/lockd. I never liked having both daemons run from the same file,
 but at the time we had decided to limit gratuitous differences with
 the NetBSD code so I couldn't do anything about. Now that we don't have
 to worry about that I think this is the proper solution.
 
 Cheers.
 -- 
 Mike Makonnen         | GPG-KEY: http://people.freebsd.org/~mtm/mtm.asc
 mmakonnen @ gmail.com | AC7B 5672 2D11 F4D0 EBF8  5279 5359 2B82 7CD4 1F55
 mtm @ FreeBSD.Org     | FreeBSD - http://www.freebsd.org
Responsible-Changed-From-To: freebsd-rc->mtm 
Responsible-Changed-By: mtm 
Responsible-Changed-When: Thu May 17 11:14:16 UTC 2007 
Responsible-Changed-Why:  
I'm working on this. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=107316 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: conf/107316: commit references a PR
Date: Fri, 17 Aug 2007 07:48:04 +0000 (UTC)

 mtm         2007-08-17 07:41:36 UTC
 
   FreeBSD src repository
 
   Modified files:
     etc/rc.d             lockd statd 
   Log:
   Repo-copy from rc.d/nfslocking ver. 1.11.
   
   PR:          conf/107316
   Approved by: re (bmah)
   
   Revision  Changes    Path
   1.15      +0 -0      src/etc/rc.d/lockd
   1.15      +0 -0      src/etc/rc.d/statd
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: conf/107316: commit references a PR
Date: Fri, 17 Aug 2007 08:08:33 +0000 (UTC)

 mtm         2007-08-17 07:58:27 UTC
 
   FreeBSD src repository
 
   Modified files:
     etc/rc.d             Makefile lockd nfslocking statd 
   Log:
   The rc.d/nfslocking file controls two servers: rpc.statd and rpc.lockd. It worked well
   in most cases, except one. The 'restart' case was not working as expected. Specifically,
   it would stop both lockd and statd, but it would restart only statd (which appears first
   in the script). This is because rc.subr(8) contains code to guard against infinite
   recursion in the 'restart' casae.
   
   To fix this use the traditional approach of controlling only one server from one script by
   breaking out rc.d/nfslocking into its contituent parts: rc.d/lockd and rc.d/statd. Keep
   rc.d/nfslocking around but don't include it in the boot rcorder(8)ing.
   
   PR:          conf/107316
   Approved by: re (bmah)
   MFC after:   2 weeks
   
   Revision  Changes    Path
   1.82      +2 -2      src/etc/rc.d/Makefile
   1.16      +2 -27     src/etc/rc.d/lockd
   1.15      +1 -1      src/etc/rc.d/nfslocking
   1.16      +2 -27     src/etc/rc.d/statd
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->patched 
State-Changed-By: matteo 
State-Changed-When: Mon Sep 17 20:49:12 UTC 2007 
State-Changed-Why:  
This was commited to HEAD but not MFC'ed yet. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=107316 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: conf/107316: commit references a PR
Date: Wed, 26 Sep 2007 11:02:36 +0000 (UTC)

 mtm         2007-09-26 11:02:29 UTC
 
   FreeBSD src repository
 
   Modified files:        (Branch: RELENG_6)
     etc/rc.d             Makefile nfslocking 
   Added files:           (Branch: RELENG_6)
     etc/rc.d             lockd statd 
   Log:
   MFC:
             Revision  Path
             1.82      src/etc/rc.d/Makefile
             1.16      src/etc/rc.d/lockd
             1.17      src/etc/rc.d/lockd
             1.18      src/etc/rc.d/lockd
             1.15      src/etc/rc.d/nfslocking
             1.16      src/etc/rc.d/statd
             1.17      src/etc/rc.d/statd
   
           Split rc.d/nfslocking into two separate scripts: rc.d/lockd
           and rc.d/statd. Keep rc.d/nfslocking for POLA reasons but do
           not run it during system startup.
   
           PR: conf/107316
   
             Revision  Path
             1.14      src/etc/rc.d/nfslocking
   
           The precmd routine does not need to check whether the comman
           should be "forced". If some pre-condition is not met, it should
           fail as it normally does and rc.subr(8) will make the appropriate
           decision. Incidentally, the previous behaviour had a bug where
           the "force" flag was respected only when checking rc.conf(5) knobs.
           The flag was ignored when verifying the rpcbind(8) dependency.
   
   Revision   Changes    Path
   1.53.2.16  +2 -2      src/etc/rc.d/Makefile
   1.18.2.1   +44 -0     src/etc/rc.d/lockd (new)
   1.11.2.2   +11 -9     src/etc/rc.d/nfslocking
   1.17.2.1   +44 -0     src/etc/rc.d/statd (new)
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: mtm 
State-Changed-When: Wed Sep 26 11:10:18 UTC 2007 
State-Changed-Why:  
MFC'ed to RELENG_6. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=107316 
>Unformatted:
