mirror of
https://git.FreeBSD.org/ports.git
synced 2025-01-03 06:04:53 +00:00
2c783ac500
PR: ports/155788 Submitted by: System Administrator <root@naboo.vindaloo.com> Pass flag to mount to disable lockd PR: ports/137378 Submitted by: kib
51 lines
855 B
Bash
51 lines
855 B
Bash
#!/bin/sh
|
|
#
|
|
# $FreeBSD$
|
|
#
|
|
# PROVIDE: cfsd
|
|
# REQUIRE: mountd
|
|
# KEYWORD: shutdown
|
|
#
|
|
# 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
|
|
#
|
|
|
|
. /etc/rc.subr
|
|
|
|
name=cfsd
|
|
rcvar=cfsd_enable
|
|
|
|
load_rc_config $name
|
|
|
|
: ${cfsd_enable:=no}
|
|
: ${cfsd_port=3049}
|
|
: ${cfsd_mountpoint=/crypt}
|
|
|
|
command=%%PREFIX%%/sbin/cfsd
|
|
command_args="$cfsd_port > /dev/null 2>&1"
|
|
required_dirs="%%CFSD_BOOTSTRAP%% $cfsd_mountpoint"
|
|
start_postcmd=cfsd_poststart
|
|
stop_precmd=cfsd_prestop
|
|
|
|
cfsd_poststart()
|
|
{
|
|
if [ -n "$cfsd_mountpoint" ]; then
|
|
mount -o port="$cfsd_port",udp,nfsv2,nolockd 127.0.0.1:%%CFSD_BOOTSTRAP%% "$cfsd_mountpoint"
|
|
fi
|
|
}
|
|
|
|
cfsd_prestop()
|
|
{
|
|
if [ -n "$cfsd_mountpoint" ]; then
|
|
umount "$cfsd_mountpoint"
|
|
fi
|
|
}
|
|
|
|
run_rc_command $1
|