Bug 133563 - security/cfs rc script needs "mntudp" option on 8-CURRENT
Summary: security/cfs rc script needs "mntudp" option on 8-CURRENT
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Chris Rees
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-10 11:40 UTC by Thiemo Nordenholz
Modified: 2011-08-17 12:00 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thiemo Nordenholz 2009-04-10 11:40:01 UTC
	Installed and started the CFS port (cfs-1.4.1_5).
	
	When /usr/local/etc/rc.d/cfsd tries to mount the cfsd-bootstrap
	directory over local NFS (in cfsd_poststart()), mount_nfs will
	hang, causing a log entry every second:
	
	Apr  9 17:52:26 feynman kernel: TCP: [127.0.0.1]:616 to
	[127.0.0.1]:3049 tcpflags 0x2<SYN>; tcp_input: Connection attempt 
	to closed port
	
	Attempts to kill mount_nfs failed.
	
	The issue was solved by adding the "mntudp" option to the init
	script so that cfsd_poststart() now does:
	
	mount -o port="$cfsd_port",nfsv2,mntudp
		localhost:/usr/local/cfsd-bootstrap "$cfsd_mountpoint"

Fix: 

Add the "mntudp" option to /usr/local/etc/rc.d/cfsd.
	However, this needs only to be done on CURRENT systems - if I had
	a good idea how to integrate this in the port, I'd submit a patch,
	but making an OSVERSION dependant hack in the Makefile seems a bit
	dirty.
How-To-Repeat: 	On 8-CURRENT:
	Install cfsd port, and prepare system as describe in the port's 
	pkg-message. Start cfsd, problem will occur.
Comment 1 Sylvio Cesar Teixeira freebsd_committer freebsd_triage 2010-05-09 02:39:20 UTC
Hi, do you have a patch to this?
Comment 2 Sylvio Cesar Teixeira freebsd_committer freebsd_triage 2010-05-09 02:39:54 UTC
Responsible Changed
From-To: freebsd-ports-bugs->sylvio

I'll take it.
Comment 3 Sylvio Cesar Teixeira freebsd_committer freebsd_triage 2010-05-09 03:17:05 UTC
State Changed
From-To: open->feedback

- Waiting feedback of submitter.
Comment 4 Thiemo Nordenholz 2010-05-10 15:14:36 UTC
Hi,

> Hi, do you have a patch to this?

No. As suggested in my "Fix" section, this seems to be release-dependent,
and I had no good idea how to build this into the ports framework. Someone
with more insight in the ports' Makefile workings might come up with a good
idea easily... I hope.

Cheers,
  Thiemo

-- 
Query a PGP key server (e.g. http://www.pgp.net/) for my public key 41068629.
Strange sender address? Please see http://www.thiemo.net/misc/list-mail.shtml
Comment 5 Sylvio Cesar Teixeira freebsd_committer freebsd_triage 2010-07-20 14:29:19 UTC
Responsible Changed
From-To: sylvio->freebsd-ports-bugs

back to pool.
Comment 6 Shaun Amott freebsd_committer freebsd_triage 2010-09-09 05:28:45 UTC
State Changed
From-To: feedback->open

Feedback received.
Comment 7 Yar Tikhiy freebsd_committer freebsd_triage 2011-01-13 23:38:29 UTC
Hi there,

This problem report is still relevant.  Please note that the original
discussion missed a few points.

First of all, the suggested fix is not quite correct.  The mount
option needed here is spelled "udp" not "mntudp", the difference being
that "mntudp" is to force _mount_ protocol to UDP transport and it
does so to NFS protocol, too, only as a side effect in more recent
mount_nfs revisions.

Cfsd is an old NFS daemon and it has no support for TCP transport
soever.  Hence the error:

[tcp] localhost:/usr/local/cfsd-bootstrap: nfsd: RPCPROG_NFS: RPC:
Remote system error - Connection refused
[tcp6] localhost:/usr/local/cfsd-bootstrap: nfsd: RPCPROG_NFS: RPC:
Remote system error - Connection refused

The fix indeed is FreeBSD version specific.  Unfortunately, historic
mount_nfs revisions had no "udp" option because it was default.

The workaround can be to use %%FOO%% magic to insert the udp option in
cfsd.sh.in if the OS version is 8.x or newer.  The resulting mount_nfs
opts need to look like this (in any order):

udp,port="$cfsd_port",nfsv2

Thanks,
Yar
Comment 8 Yar Tikhiy freebsd_committer freebsd_triage 2011-05-05 06:50:59 UTC
FWIW, there is a simple workaround to this issue.  Just set cfsd_port
in rc.conf as follows:

cfsd_port="3049,udp"

This argument will be passed to cfsd as well as to mount_nfs, but cfsd
doesn't seem to care about the `,udp' trailer.  Cfsd expects a port
number as its only argument but it doesn't seem to check if the
argument is entirely numeric -- a bug very common to older code using
atoi() or strtol(foo, NULL, ...).

Yar
Comment 9 Chris Rees freebsd_committer freebsd_triage 2011-08-17 11:44:35 UTC
Responsible Changed
From-To: freebsd-ports-bugs->crees

I'll take it.
Comment 10 dfilter service freebsd_committer freebsd_triage 2011-08-17 11:52:21 UTC
crees       2011-08-17 10:52:12 UTC

  FreeBSD ports repository

  Modified files:
    security/cfs         Makefile 
    security/cfs/files   cfsd.sh.in 
  Log:
  Fix rc script to stop nfs hangs
  
  PR:             ports/133563
  Submitted by:   Thiemo Nordenholz <list@thiemo.net>, yar
  
  Revision  Changes    Path
  1.27      +1 -1      ports/security/cfs/Makefile
  1.3       +5 -3      ports/security/cfs/files/cfsd.sh.in
_______________________________________________
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"
Comment 11 Chris Rees freebsd_committer freebsd_triage 2011-08-17 11:52:26 UTC
State Changed
From-To: open->closed

Committed. Thanks!