ports/filesystems/cfs/files/cfsd.in
Robert Clausecker 6e2da9672f filesystems: add new category for file systems and related utilities
The filesystems category houses file systems and file system utilities.
It is added mainly to turn the sysutils/fusefs-* pseudo-category into
a proper one, but is also useful for the sundry of other file systems
related ports found in the tree.

Ports that seem like they belong there are moved to the new category.
Two ports, sysutils/fusefs-funionfs and sysutils/fusefs-fusepak are
not moved as they currently don't fetch and don't have TIMESTAMP set
in their distinfo, but that is required to be able to push a rename
of the port by the pre-receive hook.

Approved by:	portmgr (rene)
Reviewed by:	mat
Pull Request:	https://github.com/freebsd/freebsd-ports/pull/302
PR:		281988
2024-11-06 16:17:35 +01:00

49 lines
880 B
Bash

#!/bin/sh
# 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
desc="Cryptographic File System daemon"
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