security/cfs fix

Daniel O'Connor doconnor at gsoft.com.au
Tue Jan 19 04:53:28 UTC 2010


Hi,
This is a quick patch to cfs which stops it stalling (forever) the
system startup if mountd fails. This can happen if mountd picks a port
which is already used (no idea why it doesn't try a few times) and then
cfsd fails.. If cfsd is not running mount will try forever (by default)
to connect.

The second part makes sure that cfsd is killed on stop even if the
umount failed for some reason.

diff -ur /usr/ports/security/cfs/files/cfsd.sh.in cfs/files/cfsd.sh.in
--- /usr/ports/security/cfs/files/cfsd.sh.in    2005-06-08 20:41:08.000000000 +0930
+++ cfs/files/cfsd.sh.in        2010-01-19 14:52:43.000000000 +1030
@@ -29,7 +29,7 @@
 cfsd_poststart()
 {
        if [ -n "$cfsd_mountpoint" ]; then
-               mount -o port="$cfsd_port",nfsv2 localhost:%%CFSD_BOOTSTRAP%% "$cfsd_mountpoint"
+               mount_nfs -R 1 -o port="$cfsd_port",nfsv2 localhost:%%CFSD_BOOTSTRAP%% "$cfsd_mountpoint"
        fi
 }

@@ -37,6 +37,7 @@
 {
        if [ -n "$cfsd_mountpoint" ]; then
                umount "$cfsd_mountpoint"
+               echo >/dev/null
        fi
 }


-- 
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
"The nice thing about standards is that there
are so many of them to choose from."
  -- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 188 bytes
Desc: This is a digitally signed message part.
Url : http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20100119/a37ba344/attachment.pgp


More information about the freebsd-ports mailing list