From: Ben Kaduk Date: Wed, 30 Mar 2011 02:26:50 +0000 (-0400) Subject: Unbreak make dest for FBSD X-Git-Tag: upstream/1.6.0.pre7^2~60 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=ddb9b2257e956e981331c5f1fff55487ce8768c5;p=packages%2Fo%2Fopenafs.git Unbreak make dest for FBSD It turns out that we do need an afs.rc.fbsd that is set up for transarc paths in this directory. To get it to work properly will require the user to symlink to it from a dir that gets checked by rcorder, but them's the breaks. Reviewed-on: http://gerrit.openafs.org/4378 Reviewed-by: Derrick Brashear Tested-by: BuildBot (cherry picked from commit 0b69fd6d5631482a786c2223a7dec0b2c9a07f92) Change-Id: Ifd921019898954414a6d107702786c546d661bd4 Reviewed-on: http://gerrit.openafs.org/4855 Reviewed-by: Derrick Brashear Tested-by: BuildBot --- diff --git a/src/afsd/afs.rc.fbsd b/src/afsd/afs.rc.fbsd new file mode 100644 index 000000000..afc78ebcc --- /dev/null +++ b/src/afsd/afs.rc.fbsd @@ -0,0 +1,74 @@ +#!/bin/sh +# +# PROVIDE: afsd +# REQUIRE: named +# KEYWORD: shutdown +# +# Symlink from /usr/local/etc/rc.d/afsd to /usr/vice/etc/afs.rc.fbsd +# and add the following lines to /etc/rc.conf.local or /etc/rc.conf +# to enable this service: +# +# afsd_enable (bool): Set to NO by default. +# Set it to YES to enable afsd. +# +# Suggested values for a "large" configuration: +# afsd_flags="-stat 2800 -daemons 5 -volumes 128" +# +# Suggested values for a "medium" configuration: +# afsd_flags="-stat 2000 -daemons 3 -volumes 70" +# +# Suggested values for a "small" configuration: +# afsd_flags="-stat 300 -daemons 2 -volumes 50" + +. /etc/rc.subr + +name="afsd" +rcvar="afsd_enable" + +command="/usr/vice/etc/afsd" +command_args="-dynroot -fakestat-all -afsdb -memcache" + +start_precmd="afsd_prestart" +start_postcmd="afsd_poststart" +stop_cmd="afsd_stop" + +kmod="libafs" +vicedir="/usr/vice/etc" +required_modules="libafs:afs" +required_files="${vicedir}/cacheinfo ${vicedir}/ThisCell ${vicedir}/CellServDB" + +load_rc_config "$name" + +: ${afsd_enable:="NO"} +: ${afsd_flags:="-stat 2800 -daemons 6 -volumes 128"} + +afsd_prestart() +{ + local dir + + # need a mountpoint and a cache dir (well, if we have a disk cache) + # Should use required_dirs, but no good way to extract from cacheinfo + for dir in $(awk -F: '{print $1, $2}' ${vicedir}/cacheinfo); do + if [ ! -d "${dir}" ]; then + err 1 "Directory ${dir} does not exist. Not starting AFS client." + fi + done +} + +afsd_poststart() +{ + /usr/local/bin/fs setcrypt -crypt on +} + +afsd_stop() +{ + local afsdir + + afsdir=$(awk -F: '{print $1}' ${vicedir}/cacheinfo) + if ! umount $afsdir; then + [ -n "${rc_force}" ] && umount -f ${afsdir} + fi + kldunload ${kmod} +} + +run_rc_command "$1"