aboutsummaryrefslogtreecommitdiff
path: root/scripts/os/freebsd/51-autofs
diff options
context:
space:
mode:
authorCullum Smith <cullum@sacredheartsc.com>2024-10-15 23:35:53 -0400
committerCullum Smith <cullum@sacredheartsc.com>2024-10-15 23:35:53 -0400
commit145668c3dd67c5271eddcb62d1e7843487d768a7 (patch)
tree4c7d563e9d320e6b122ee3dbf048d93eee6776c3 /scripts/os/freebsd/51-autofs
parentb2af400a1098ebf445575d169e11a6717867045f (diff)
downloadinfrastructure-145668c3dd67c5271eddcb62d1e7843487d768a7.tar.gz
huge amount of fixes
Diffstat (limited to 'scripts/os/freebsd/51-autofs')
-rw-r--r--scripts/os/freebsd/51-autofs33
1 files changed, 33 insertions, 0 deletions
diff --git a/scripts/os/freebsd/51-autofs b/scripts/os/freebsd/51-autofs
new file mode 100644
index 0000000..4fe3c52
--- /dev/null
+++ b/scripts/os/freebsd/51-autofs
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+# NFS mounts are not supported within jails.
+if [ "$BOXCONF_VIRTUALIZATION_TYPE" = jail ] || \
+ [ "$BOXCONF_HOSTCLASS" = nfs_server ] || \
+ [ "${enable_idm:-}" = false ] || \
+ [ "${enable_autofs:-}" = false ]; then
+ return 0
+fi
+
+: ${nfsuserd_cache_size:='256'}
+: ${nfsuserd_num_servers:='4'}
+: ${nfsuserd_cache_timeout:='1'}
+
+sysrc -v \
+ nfsuserd_enable=YES \
+ nfsuserd_flags="-usermax ${nfsuserd_cache_size} -usertimeout ${nfsuserd_cache_timeout} ${nfsuserd_num_servers}" \
+ gssd_enable=YES \
+ gssd_flags='-h -s /tmp' \
+ gssd_env="KRB5_KTNAME=${keytab_dir}/host.keytab"
+ nfs_client_enable=YES \
+ nfscbd_enable=NO \
+ nfscbd_flags="-p ${nfscbd_port} -P host" \
+ autofs_enable=YES
+
+install_file -m 0644 /etc/auto_master
+install_file -m 0555 /usr/local/libexec/idm-autofs-map
+ln -snfv /usr/local/libexec/idm-autofs-map /etc/autofs/include
+
+# No nfscbd: causes kernel panics on FreeBSD 14.1
+for service in gssd nfsclient nfsuserd automount automountd autounmountd; do
+ service "$service" status || service "$service" start
+done