Instead of commenting out an example full salvage of the server, suggest a

volume by volume salvage by default.  This way, servers with lots of files
can be up salvaging volume by volume instead of down until the last volume
is salvaged.
"if it works, go for it" ckuethe@
This commit is contained in:
todd 2008-10-24 19:59:18 +00:00
parent 987e1e6aa9
commit 5dff884143
2 changed files with 36 additions and 8 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.23 2008/10/21 02:57:51 todd Exp $
# $OpenBSD: Makefile,v 1.24 2008/10/24 19:59:18 todd Exp $
ONLY_FOR_ARCHS= i386
@ -6,7 +6,7 @@ COMMENT= OpenAFS distributed filesystem
VERSION= 1.4.7
DISTNAME= openafs-${VERSION}
PKGNAME= ${DISTNAME}p4
PKGNAME= ${DISTNAME}p5
CATEGORIES= net

View File

@ -26,20 +26,48 @@ are brief instructions to do so. See 'info heimdal' for further details.
Once the KerberosV realm is setup, run '${PREFIX}/sbin/openafs-setup'
to setup your first OpenAFS server in your cell.
Finally, you should add the below to /etc/rc.local:
Add the below to /etc/rc.local:
if [ -x ${PREFIX}/sbin/bosserver ]; then
echo -n " openafs"
PATH=${PREFIX}/bin:${PREFIX}/sbin:$PATH
${PREFIX}/sbin/bosserver -log -syslog
# help this detach from console, proper fix is to properly daemonize!
sh -c "bosserver -log -syslog > /dev/null 2>&1 &"
# give the servers started by bosserver time to settle
# before attacking it with salvaging activity
sleep 10
# to salvage automatically on startup, for the paranoid
#echo -n "(salvaging afs volumes ..."
#${PREFIX}/bin/bos salvage localhost -all -orphans attach -localauth
#echo -n " done)"
echo -n "(salvaging"
set -A volumes $(
vos listvol localhost -noauth 2> /dev/null| \
awk '
/ partition / { sub(":","",$9); part=$9; next; }
/R[OW].* K .*-line/ { printf "%s %s\n",part,$2; }'
)
# 20 dots total, adjust based on volume count
freq=$((${#volumes[*]}/20))
i=0
while [ i -lt ${#volumes[*]} ]
do
# progress by volume count
if [ $(((i/2)%freq)) -eq 0 ]; then
echo -n .
fi
part=${volumes[$i]}
let i=i+1
vid=${volumes[$i]}
let i=i+1
bos salvage localhost $part $vid -localauth > /var/tmp/$vid.log 2>&1
done
echo -n ")"
fi
and add the following to /etc/rc.shutdown:
Add the following to /etc/rc.shutdown:
if [ -x ${PREFIX}/bin/bos ]; then
${PREFIX}/bin/bos shutdown localhost -localauth -wait