Commit 13d74b43 authored by Mike Hibler's avatar Mike Hibler

Automate some of the support for using autofs rather than amd.

This will only be for boss and for FreeBSD 10.2 and beyond.
parent 1c47bf72
......@@ -52,10 +52,10 @@ SUBDIRS = \
clientside/lib \
db assign www @optional_subdirs@ clientside ipod security sensors \
pxe tbsetup account tmcd utils backend tip ipod vis \
sensors os xmlrpc install/newnode_sshkeys tools/whol \
sensors os xmlrpc autofs install/newnode_sshkeys \
tools/svn wiki collab/exp-vis node_usage install
ifeq ($(ISMAINSITE),1)
SUBDIRS += tools/rmanage
SUBDIRS += tools/rmanage tools/whol
endif
ifeq ($(PGENISUPPORT),1)
SUBDIRS += protogeni apt
......
#
# Copyright (c) 2015 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
# This file is part of the Emulab network testbed software.
#
# This file is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at
# your option) any later version.
#
# This file is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
# License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this file. If not, see <http://www.gnu.org/licenses/>.
#
# }}}
#
#
# For installation only.
#
SRCDIR = @srcdir@
TESTBED_SRCDIR = @top_srcdir@
OBJDIR = ..
SUBDIR = autofs
SYSETCDIR = $(DESTDIR)/etc
SYSTEM := $(shell uname -s)
ifeq ($(SYSTEM),FreeBSD)
FBSDREL := $(shell uname -r | sed -e 's/\([^-][^-]*\)-.*/\1/')
FBSDMAJ := $(basename $(FBSDREL))
endif
include $(OBJDIR)/Makeconf
AUTOFS_FILES = autofs_boss.sh
#
# Force dependencies to make sure configure regenerates if the .in file
# is changed.
#
all: $(AUTOFS_FILES)
include $(TESTBED_SRCDIR)/GNUmakerules
freebsd-os-check:
@if [ -z "$(FBSDMAJ)" -o $(FBSDMAJ) -lt 10 -o \
\( $(FBSDMAJ) -eq 10 -a \
\( $(FBSDREL) = "10.0" -o $(FBSDREL) = "10.1" \) \) ]; then \
echo "Can only install autofs on FreeBSD 10.2 or later"; \
false; \
fi
first-install: freebsd-os-check install
$(INSTALL) -m 644 $(SRCDIR)/auto_master $(SYSETCDIR)/auto_master
ln -sf $(INSTALL_ETCDIR)/autofs_boss.sh $(SYSETCDIR)/auto_users
ln -sf $(INSTALL_ETCDIR)/autofs_boss.sh $(SYSETCDIR)/auto_proj
ln -sf $(INSTALL_ETCDIR)/autofs_boss.sh $(SYSETCDIR)/auto_groups
@echo "NOTE: Be sure to add 'autofs_enable=\"YES\"' to /etc/rc.conf"
install: all
$(INSTALL) -m 755 autofs_boss.sh $(INSTALL_ETCDIR)/autofs_boss.sh
post-install:
control-install:
clean:
rm -f $(AUTOFS_FILES)
# $FreeBSD: releng/10.2/etc/auto_master 283242 2015-05-21 13:42:37Z trasz $
#
# Automounter master map, see auto_master(5) for details.
#
# This version is customized for the Emulab boss node to access the fs node
# filesystem when fs is using ZFS to provide per-user, per-project
# filesystems. The auto_* maps below are symlinked to the auto_boss.sh
# script that provides an executable map to identify valid filesystems that
# are exported.
#
/users auto_users -nobrowse
/proj auto_proj -nobrowse
/groups auto_groups -nobrowse
#!/bin/sh
#
# Copyright (c) 2000-2015 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
# This file is part of the Emulab network testbed software.
#
# This file is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at
# your option) any later version.
#
# This file is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
# License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this file. If not, see <http://www.gnu.org/licenses/>.
#
# }}}
#
#
# Script invoked by FreeBSD autofs to return info for valid fs mountpoints.
# Must be executable and must be a /bin/sh script.
#
TB=@prefix@
mountopts="-nosuid,vers=3,tcp"
case $0 in
*auto_users*)
map=users
;;
*auto_proj*)
map=proj
;;
*auto_groups*)
map=groups
;;
*auto_scratch*)
map=scratch
;;
*)
exit 1
;;
esac
if [ $# -eq 0 ]; then
if [ ! -f "$TB/etc/validmounts.txt" ]; then
exit 1
fi
list=`grep -s "^/$map/" $TB/etc/validmounts.txt | sed -e "s;^/$map/;;"`
for l in $list; do
echo "$l $mountopts fs:/$map/$l"
done
exit 0
fi
key=$1
if test -f "$TB/etc/validmounts.txt" &&
! grep -q "^/$map/$key\$" $TB/etc/validmounts.txt; then
# apparently returning no error is the right thing do to
exit 0
fi
echo "$mountopts fs:/$map/$key"
exit 0
......@@ -6992,7 +6992,7 @@ outfiles="$outfiles Makeconf GNUmakefile \
xmlrpc/imageid xmlrpc/osid xmlrpc/server xmlrpc/xmlrpcbag \
cdrom/GNUmakefile cdrom/tbbootconfig/GNUmakefile \
cdrom/groklilo/GNUmakefile \
flash/GNUmakefile \
autofs/GNUmakefile flash/GNUmakefile \
dhcpd/dhcpd.conf.template dhcpd/GNUmakefile \
dhcpd/dhcpd.conf.subboss.template \
ntpd/GNUmakefile \
......
......@@ -1361,7 +1361,7 @@ outfiles="$outfiles Makeconf GNUmakefile \
xmlrpc/imageid xmlrpc/osid xmlrpc/server xmlrpc/xmlrpcbag \
cdrom/GNUmakefile cdrom/tbbootconfig/GNUmakefile \
cdrom/groklilo/GNUmakefile \
flash/GNUmakefile \
autofs/GNUmakefile flash/GNUmakefile \
dhcpd/dhcpd.conf.template dhcpd/GNUmakefile \
dhcpd/dhcpd.conf.subboss.template \
ntpd/GNUmakefile \
......
......@@ -182,6 +182,8 @@ ZFS_QUOTA_USER="1G"
ZFS_QUOTA_PROJECT="100G"
ZFS_QUOTA_GROUP="5G"
ZFS_NOEXPORT=1
# WITHZFS only: use AMD instead of autofs for /proj, /users mounts on boss
WITHAMD=0
# Utah-only hacked mountd
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment