6 # REQUIRE: afsserver named
9 # We require afsserver for the (rare, untested) case when a client
10 # and server are running on the same machine -- the client must not
11 # start until the server is running.
13 # Add the following lines to /etc/rc.conf.local or /etc/rc.conf
14 # to enable this service:
16 # afsd_enable (bool): Set to NO by default.
17 # Set it to YES to enable afsd.
19 # Suggested values for a "large" configuration:
20 # afsd_flags="-stat 2800 -daemons 5 -volumes 128"
22 # Suggested values for a "medium" configuration:
23 # afsd_flags="-stat 2000 -daemons 3 -volumes 70"
25 # Suggested values for a "small" configuration:
26 # afsd_flags="-stat 300 -daemons 2 -volumes 50"
33 command="%%PREFIX%%/sbin/${name}"
34 command_args="-dynroot -fakestat-all -afsdb -memcache"
36 start_precmd="afsd_prestart"
37 start_postcmd="afsd_poststart"
41 vicedir="%%PREFIX%%/etc/openafs"
42 required_modules="libafs:afs"
43 required_files="${vicedir}/cacheinfo ${vicedir}/ThisCell ${vicedir}/CellServDB"
45 load_rc_config "$name"
47 : ${afsd_enable:="NO"}
48 : ${afsd_flags:="-stat 2800 -daemons 6 -volumes 128"}
54 # need a mountpoint and a cache dir (well, if we have a disk cache)
55 # Should use required_dirs, but no good way to extract from cacheinfo
56 for dir in $(awk -F: '{print $1, $2}' ${vicedir}/cacheinfo); do
57 if [ ! -d "${dir}" ]; then
58 err 1 "Directory ${dir} does not exist. Not starting AFS client."
65 %%PREFIX%%/bin/fs setcrypt -crypt on
72 afsdir=$(awk -F: '{print $1}' ${vicedir}/cacheinfo)
73 if ! umount $afsdir; then
74 [ -n "${rc_force}" ] && umount -f ${afsdir}