- convert cfsd.sh to rcNG

- add a CFS bootstrap directory to the port (${PREFIX}/cfsd-bootstrap)
- mount that CFS bootstrap directory in cfsd.sh (default mountpoint is /crypt,
  configurable in /etc/rc.conf)
- explain how to quickly setup cfsd in pkg-message
- do display pkg-message
- while here, use USE_RC_SUBR

PR:		ports/18800
Submitted by:	Louis Mamakos <louie@TransSys.COM>, myself
Approved by:	green (maintainer)
This commit is contained in:
Jean-Yves Lefort 2005-06-08 11:11:08 +00:00
parent 6d5f88e778
commit 19c9380f0d
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=137043
7 changed files with 89 additions and 30 deletions

View file

@ -7,7 +7,7 @@
PORTNAME= cfs
PORTVERSION= 1.4.1
PORTREVISION= 3
PORTREVISION= 4
CATEGORIES= security
MASTER_SITES= http://www.crypto.com/software/
@ -19,6 +19,12 @@ ALL_TARGET= cfs
MAN1= cattach.1 cdetach.1 cmkdir.1 cpasswd.1 cfssh.1
MAN8= ccat.8 cfsd.8 cname.8
CFSD_BOOTSTRAP= ${PREFIX}/cfsd-bootstrap
USE_RC_SUBR= cfsd.sh
SUB_FILES= pkg-message
SUB_LIST= CFSD_BOOTSTRAP=${CFSD_BOOTSTRAP}
PLIST_SUB= CFSD_BOOTSTRAP=${CFSD_BOOTSTRAP}
post-patch:
${REINPLACE_CMD} 's/^\.TH SSH/.TH CFSSH/' ${WRKSRC}/cfssh.1
@ -31,8 +37,7 @@ do-install:
${INSTALL_MAN} ${MAN8} ${PREFIX}/man/man8; \
${MKDIR} ${PREFIX}/share/doc/cfs; \
${INSTALL_DATA} README.install notes.ms ${PREFIX}/share/doc/cfs
@if [ ! -f ${PREFIX}/etc/rc.d/cfsd.sh ]; then \
${INSTALL_SCRIPT} -m 751 ${FILESDIR}/cfsd.sh ${PREFIX}/etc/rc.d/cfsd.sh; \
fi
${INSTALL} -d ${_BINOWNGRP} -m 0 ${CFSD_BOOTSTRAP}
@${CAT} ${PKGMESSAGE}
.include <bsd.port.mk>

View file

@ -1,20 +0,0 @@
#!/bin/sh
if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then
echo "$0: Cannot determine the PREFIX" >&2
exit 1
fi
case "$1" in
start)
[ -x ${PREFIX}/sbin/cfsd ] && ${PREFIX}/sbin/cfsd > /dev/null 2>&1 && echo -n ' cfsd'
;;
stop)
killall cfsd && echo -n ' cfsd'
;;
*)
echo "Usage: `basename $0` {start|stop}" >&2
;;
esac
exit 0

View file

@ -0,0 +1,51 @@
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: cfsd
# REQUIRE: mountd
#
# Add the following line to /etc/rc.conf to enable cfsd:
#
# cfsd_enable="YES"
#
# Additional options:
#
# cfsd_port="3049" # the port to listen to
# cfsd_mountpoint="/crypt" # the CFS mountpoint
#
. %%RC_SUBR%%
name="cfsd"
rcvar=`set_rcvar`
command="%%PREFIX%%/sbin/cfsd"
start_postcmd="cfsd_poststart"
stop_precmd="cfsd_prestop"
cfsd_poststart()
{
if [ -n "$cfsd_mountpoint" ]; then
mount -o port="$cfsd_port",nfsv2 localhost:%%CFSD_BOOTSTRAP%% "$cfsd_mountpoint"
fi
}
cfsd_prestop()
{
if [ -n "$cfsd_mountpoint" ]; then
umount "$cfsd_mountpoint"
fi
}
load_rc_config $name
: ${cfsd_enable="NO"}
: ${cfsd_port="3049"}
: ${cfsd_mountpoint="/crypt"}
command_args="$cfsd_port >/dev/null 2>&1"
required_dirs="%%CFSD_BOOTSTRAP%% $cfsd_mountpoint"
run_rc_command "$1"

View file

@ -0,0 +1,27 @@
===============================================================================
Quick start instructions:
- add the following entry to /etc/exports:
%%CFSD_BOOTSTRAP%% localhost
- create the default CFS mountpoint (if you want to use a different
mountpoint, set the cfsd_mountpoint variable in /etc/rc.conf):
mkdir /crypt
- enable rpcbind, mountd and cfsd in /etc/rc.conf:
FreeBSD 4.x:
portmap_enable="YES"
single_mountd_enable="YES"
cfsd_enable="YES"
FreeBSD 5.x:
mountd_enable="YES"
cfsd_enable="YES"
- reboot the system
===============================================================================

View file

@ -8,9 +8,6 @@ and the manual pages. There is a paper describing CFS at:
http://www.crypto.com/papers/cfs.pdf
Under FreeBSD, the mount command for the CFS tree must include
"-o port=3049,nfsv2".
WWW: http://www.crypto.com/software/
John Polstra <jdp@polstra.com>

View file

@ -1,2 +0,0 @@
Please make sure to edit rc.conf(5) to include -L in the flags for
rpcbind(8) if necessary.

View file

@ -3,10 +3,11 @@ bin/cdetach
bin/cmkdir
bin/cpasswd
bin/cfssh
etc/rc.d/cfsd.sh
sbin/ccat
sbin/cfsd
sbin/cname
share/doc/cfs/README.install
share/doc/cfs/notes.ms
@exec install -d -o root -g wheel -m 0 %%CFSD_BOOTSTRAP%% 2>/dev/null || true
@unexec rmdir %%CFSD_BOOTSTRAP%% 2>/dev/null || true
@dirrm share/doc/cfs