mirror of
https://github.com/opnsense/src.git
synced 2026-02-27 03:40:37 -05:00
startmsg is a new rc.subr(8) function function to be used instead of
echo(1) when for boot messages. It replaces the often forgotten
check_startmsgs && echo ...
with
startmsg ...
No functional change intended.
I adjusted the commit message and did some final clean-ups of the patch
before committing.
PR: 255207
Reported by: Jose Luis Duran <jlduran@gmail.com>
Reviewed by: imp, 0mp
Approved by: imp (src)
Differential Revision: https://reviews.freebsd.org/D34514
50 lines
1 KiB
Bash
Executable file
50 lines
1 KiB
Bash
Executable file
#!/bin/sh
|
|
#
|
|
# $FreeBSD$
|
|
#
|
|
|
|
# PROVIDE: nfsclient
|
|
# REQUIRE: NETWORKING mountcritremote rpcbind
|
|
# KEYWORD: nojail shutdown
|
|
|
|
. /etc/rc.subr
|
|
|
|
name="nfsclient"
|
|
desc="NFS client setup"
|
|
rcvar="nfs_client_enable"
|
|
start_cmd="nfsclient_start"
|
|
stop_cmd="unmount_all"
|
|
required_modules="nfscl:nfs"
|
|
|
|
nfsclient_start()
|
|
{
|
|
#
|
|
# Set some nfs client related sysctls
|
|
#
|
|
|
|
if [ -n "${nfs_access_cache}" ]; then
|
|
startmsg "NFS access cache time=${nfs_access_cache}"
|
|
if ! sysctl vfs.nfs.access_cache_timeout=${nfs_access_cache} >/dev/null; then
|
|
warn "failed to set access cache timeout"
|
|
fi
|
|
fi
|
|
if [ -n "${nfs_bufpackets}" ]; then
|
|
if ! sysctl vfs.nfs.bufpackets=${nfs_bufpackets} > /dev/null; then
|
|
warn "failed to set vfs.nfs.bufpackets"
|
|
fi
|
|
fi
|
|
|
|
unmount_all
|
|
}
|
|
|
|
unmount_all()
|
|
{
|
|
# If /var/db/mounttab exists, some nfs-server has not been
|
|
# successfully notified about a previous client shutdown.
|
|
# If there is no /var/db/mounttab, we do nothing.
|
|
if [ -f /var/db/mounttab ]; then
|
|
rpc.umntall -k
|
|
fi
|
|
}
|
|
load_rc_config $name
|
|
run_rc_command "$1"
|