diff options
author | 2001-06-01 21:41:19 +0000 | |
---|---|---|
committer | 2001-06-01 21:41:19 +0000 | |
commit | 8e22c3f2023bc12dc8bdfe28bed53e485941f0eb (patch) | |
tree | bb3e03a86df0841a754020b1b30fe2d36d384be6 /net-fs/openafs | |
parent | config file management (test version) (diff) | |
download | historical-8e22c3f2023bc12dc8bdfe28bed53e485941f0eb.tar.gz historical-8e22c3f2023bc12dc8bdfe28bed53e485941f0eb.tar.bz2 historical-8e22c3f2023bc12dc8bdfe28bed53e485941f0eb.zip |
|darks|'s new fixed version of openafs
Diffstat (limited to 'net-fs/openafs')
-rw-r--r-- | net-fs/openafs/files/afs.rc | 72 | ||||
-rw-r--r-- | net-fs/openafs/openafs-1.0.4-r1.ebuild | 13 |
2 files changed, 58 insertions, 27 deletions
diff --git a/net-fs/openafs/files/afs.rc b/net-fs/openafs/files/afs.rc index 780bf7f1d135..71fc6337d972 100644 --- a/net-fs/openafs/files/afs.rc +++ b/net-fs/openafs/files/afs.rc @@ -17,13 +17,43 @@ # # Note that AFS does not use a pid file in /var/run. It is turned off by # unmounting /afs. - +# +# Modified by Holger Brueckner <darks@fet.org> for gentoo-linux # Gather up options and post startup script name, if present if [ -f /etc/afs/afs.conf ]; then . /etc/afs/afs.conf fi + +# include gentoo functions +. /etc/rc.d/config/functions +opts="start stop" + +# check for ext2 partition + +check_ext2() { + PART=`cat /proc/mounts | grep vice | grep ext2 | awk '{print $1}'` + if [ -z $PART ] + then + echo ">>> PLEASE CREATE A EXT2 (no reiserfs) PARTITION (of aprox. 200M)" + echo ">>> AND MOUNT IT TO /USR/VICE/CACHE !!!" + exit 1 + fi +} + +# check if cacheinfo exist, otherwise create it !! + +check_cacheinfo(){ + [ ! -f /usr/vice/etc/cacheinfo ] && { + PART=`cat /proc/mounts | grep vice | grep ext2 | awk '{print $1}'` + CACHESIZE=`df $PART | grep ^/ | awk '{print $4}'` + CACHESIZE=`expr $CACHESIZE \* 9` + CACHESIZE=`expr $CACHESIZE / 10` + echo "/afs:/usr/vice/cache:$CACHESIZE" > /usr/vice/etc/cacheinfo + } +} + # is_on returns 1 if value of arg is "on" is_on() { if test "$1" = "on" ; then return 0 @@ -126,41 +156,47 @@ load_client() { /sbin/insmod ${PREFIX:+-P $PREFIX} -f -m $MODLOADDIR/$LIBAFS > $MODLOADDIR/libafs.map 2>&1 } -case "$1" in - start) +start(){ # Load kernel extensions + + check_ext2 + check_cacheinfo + + ebegin "Starting AFS services" + if load_client ; then : else echo Failed to load AFS client, not starting AFS services. - exit 1 + eend 1 "Error Starting AFS client" fi - echo "Starting AFS services..... " # Start bosserver, it if exists if is_on $AFS_SERVER && test -x /usr/afs/bin/bosserver ; then /usr/afs/bin/bosserver fi # Start AFS client - if is_on $AFS_CLIENT && test -x /usr/vice/etc/afsd ; then - /usr/vice/etc/afsd ${OPTIONS} - + if is_on $AFS_CLIENT && test -x /usr/sbin/afsd ; then + /usr/sbin/afsd ${OPTIONS} 1>&2 + STATUS=$? # Start AFS version of inetd.conf if present. if test -f /usr/afsws/etc/inetd.conf -a -x /usr/afsws/etc/inetd.afs ; then /usr/afsws/etc/inetd.afs /usr/afsws/etc/inetd.conf fi $AFS_POST_INIT fi + eend $STATUS "Error starting AFS" - ;; +} - stop) +stop() { # Stop AFS - echo "Stopping AFS services..... " + ebegin "Stopping AFS services" if is_on $AFS_CLIENT ; then - killall inetd.afs +# killall inetd.afs umount /afs + STATUS=$? fi if is_on $AFS_SERVER && test -x /usr/afs/bin/bos ; then @@ -173,12 +209,10 @@ case "$1" in if [ -n "$LIBAFS" ] ; then LIBAFS=`echo $LIBAFS | awk 'BEGIN { FS = " " } { print $1 }'` /sbin/rmmod $LIBAFS + STATUS=$? fi + eend $STATUS "Error starting AFS" - ;; - - *) - echo Usage: 'afs <start|stop>' - -esac - +} + +doservice ${@} diff --git a/net-fs/openafs/openafs-1.0.4-r1.ebuild b/net-fs/openafs/openafs-1.0.4-r1.ebuild index f5d07ed9f0d6..d7e10a92c76d 100644 --- a/net-fs/openafs/openafs-1.0.4-r1.ebuild +++ b/net-fs/openafs/openafs-1.0.4-r1.ebuild @@ -20,15 +20,12 @@ DEPEND="virtual/glibc src_compile() { - export KERNELVERSION=`grep "UTS_RELEASE" /usr/src/linux/include/linux/version.h | awk '{print $3}'` - KERNELSHORT="24" + export KERNELVERSION=`grep "UTS_RELEASE" /usr/src/linux/include/linux/version.h | awk '{print $3}' | sed "s/\"//g"` + KERNELSHORT=`echo $KERNELVERSION | cut -c1-3 | sed "s/\.//"` SYSTEM="linux" SYSARCH="i386" CELLNAME=`cat ${FILESDIR}/ThisCell` - # should be around 90% of actual free space - CACHESIZE=200000 - try mkdir ${SYSARCH}_${SYSTEM}${KERNELSHORT} try mkdir ${SYSARCH}_${SYSTEM}${KERNELSHORT}/dest try mkdir ${SYSARCH}_${SYSTEM}${KERNELSHORT}/obj @@ -71,11 +68,11 @@ src_install () { exeinto /usr/afsws/bin doexe bin/* - exeinto /etc/afsws + exeinto /etc/afs/afsws doexe etc/* cp -a include lib ${D}/usr/afsws - dosym /usr/afswf/lib/afs/libtermlib.a /usr/afsws/lib/afs/libnull.a + dosym /usr/afsws/lib/afs/libtermlib.a /usr/afsws/lib/afs/libnull.a # Server cd ${S}/dest/root.server/usr/afs @@ -84,7 +81,7 @@ src_install () { dodir /usr/vice dosym /etc/afs /usr/vice/etc - dosym /etc/afsws /usr/afsws/etc + dosym /etc/afs/afsws /usr/afsws/etc } |