Compare commits

...

No commits in common. "v963" and "v961" have entirely different histories.
v963 ... v961

5 changed files with 75 additions and 112 deletions

View File

@ -39,65 +39,52 @@
# #
source /etc/sysconfig/autofstime initmount()
source /etc/init.d/functions {
MOUNTSOURCE=$1
AUTOMOUNTSOURCE=$2
sed -e '/^#/d' |\
sed -e '/^ *$/d' >/tmp/autofs
exec 3</tmp/autofs
read <&3 MOUNTPOINT FILE
while [ "$MOUNTPOINT" ]; do
echo -n "starting automount for $MOUNTPOINT ($MOUNTSOURCE)"
automount -t $TIMEOUT $MOUNTPOINT $AUTOMOUNTSOURCE,sun $FILE
evaluate_retval
read <&3 MOUNTPOINT FILE
done
exec 3>&-
rm /tmp/autofs
}
source /etc/sysconfig/autofstime
source /etc/init.d/functions
case "$1" in case "$1" in
start) start)
if [ -f /etc/sysconfig/auto.master ] && grep automount /etc/nsswitch.conf|grep -q files; then if [ -f /etc/nsswitch.conf ]; then
if [ -f /var/run/autofs/automount_files.pid ]; then for MOUNTSOURCE in `grep automount /etc/nsswitch.conf | awk '{ $1=""; print; };'`; do
if ps -ef|awk '{print $2}'|grep -q `cat /var/run/autofs/automount_files.pid`; then case "$MOUNTSOURCE" in
echo -n "Automount already running" files)
print_status failure if [ -f /etc/sysconfig/auto.master ]; then
exit 10 cat /etc/sysconfig/auto.master| initmount files file
else fi
echo -n "Removing old files" ;;
rm /var/run/autofs/automount_files.pid nis)
fi ypcat -k auto.master 2>/dev/null| initmount nis yp
fi ;;
echo -n "Starting automount for local auto.master" default)
automount -v -p /var/run/autofs/automount_files.pid -t $TIMEOUT /etc/sysconfig/auto.master echo "no such source for automount: "$MOUNTSOURCE
evaluate_retval esac
fi done
if grep automount /etc/nsswitch.conf|grep -q nis; then fi
if [ -f /var/run/autofs/automount_nis.pid ]; then
if ps -ef|awk '{print $2}'|grep -q `cat /var/run/autofs/automount_nis.pid`; then
echo -n "Automount for nis already running"
print_status failure
exit 10
else
echo -n "Removing old files"
rm /var/run/autofs/automount_nis.pid
fi
fi
echo -n "Starting automount for nis"
automount -C -v -v -p /var/run/autofs/automount_nis.pid -t $TIMEOUT auto.master
evaluate_retval
fi
;; ;;
stop) stop)
if [ -f /var/run/autofs/automount_files.pid ]; then echo -n "shutting down autofs"
if ps -ef|awk '{print $2}'|grep -q `cat /var/run/autofs/automount_files.pid`; then pkill automount
echo -n "shutting down autofs" evaluate_retval
kill `cat /var/run/autofs/automount_files.pid`
evaluate_retval
else
echo -n "PID `cat /var/run/autofs/automount_files.pid` not existing - cleaning up"
rm /var/run/autofs/automount_files.pid
evaluate_retval
fi
fi
if [ -f /var/run/autofs/automount_nis.pid ]; then
if ps -ef|awk '{print $2}'|grep -q `cat /var/run/autofs/automount_nis.pid`; then
echo -n "shutting down autofs"
kill `cat /var/run/autofs/automount_nis.pid`
evaluate_retval
else
echo -n "PID `cat /var/run/autofs/automount_nis.pid` not existing - cleaning up"
rm /var/run/autofs/automount_nis.pid
evaluate_retval
fi
fi
;; ;;
restart) restart)
$0 stop $0 stop

View File

@ -1,20 +0,0 @@
description "Startup autofs System for nis configuration files"
author "Harald Kueller <harald.kueller@compuextreme.de>"
version 1.0
emits none special
start on ( runlevel [2345] and ( started ypclient ))
stop on stopping ypclient
console output
pre-start script
source /etc/init/functions
if grep automount /etc/nsswitch.conf|grep -q nis; then
/sbin/CheckPid /var/run/autofs/automount_nis.pid
else
exit 10
fi
end script
exec automount -f -C -p /var/run/autofs/automount_nis.pid -t `cat /etc/sysconfig/autofstime` nis:auto.master

View File

@ -1,20 +0,0 @@
description "Startup autofs System for local configuration files"
author "Harald Kueller <harald.kueller@compuextreme.de>"
version 1.0
emits none special
start on (runlevel [2345] and (started mountfs))
stop on runlevel [016]
console none
pre-start script
source /etc/init/functions
if [ -f /etc/sysconfig/auto.master ] && grep automount /etc/nsswitch.conf|grep -q files; then
CheckPid /var/run/autofs/automount_files.pid
else
exit 10
fi
end script
exec automount -f -p /var/run/autofs/automount_files.pid -t `cat /etc/sysconfig/autofstime` /etc/sysconfig/auto.master

View File

@ -1 +1,19 @@
3 #!/bin/bash
#Definition der Timeout Zeit für autofs. Nach $TIMEOUT Sekunden nicht
#benutzt werden, wird ein autofs mount wieder dismounted
#(c) Rainmaker MultiMedia OHG
#
#$Author$
#$Date$
#$Revision$
#
#$Log$
#Revision 1.1 2001/09/23 00:10:47 kueller
#Initial revision
#
#Revision 1.1.1.1 2001/08/25 16:21:48 kueller
#AddOns fuer autofs
#
#
TIMEOUT=3

View File

@ -22,20 +22,18 @@
# #
# #
if [ -d /var/install/sysvinit* ]; then WDIR=`pwd`
WDIR=`pwd` cd etc/init.d
cd etc/init.d chmod 755 autofs
chmod 755 autofs mkdir rc{0,1,2,3,4,5,6}.d
mkdir rc{0,1,2,3,4,5,6}.d for i in 0 1 6; do
for i in 0 1 6; do cd rc$i.d
cd rc$i.d ln -s ../autofs K75autofs
ln -s ../autofs K75autofs cd ..
cd .. done
done for i in 2 3 4 5; do
for i in 2 3 4 5; do cd rc$i.d
cd rc$i.d ln -s ../autofs S14autofs
ln -s ../autofs S14autofs cd ..
cd .. done
done cd $WDIR
cd $WDIR
fi