Compare commits
No commits in common. "v961" and "v963" have entirely different histories.
@ -39,52 +39,65 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
initmount()
|
|
||||||
{
|
|
||||||
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/sysconfig/autofstime
|
||||||
|
|
||||||
source /etc/init.d/functions
|
source /etc/init.d/functions
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
start)
|
start)
|
||||||
if [ -f /etc/nsswitch.conf ]; then
|
if [ -f /etc/sysconfig/auto.master ] && grep automount /etc/nsswitch.conf|grep -q files; then
|
||||||
for MOUNTSOURCE in `grep automount /etc/nsswitch.conf | awk '{ $1=""; print; };'`; do
|
if [ -f /var/run/autofs/automount_files.pid ]; then
|
||||||
case "$MOUNTSOURCE" in
|
if ps -ef|awk '{print $2}'|grep -q `cat /var/run/autofs/automount_files.pid`; then
|
||||||
files)
|
echo -n "Automount already running"
|
||||||
if [ -f /etc/sysconfig/auto.master ]; then
|
print_status failure
|
||||||
cat /etc/sysconfig/auto.master| initmount files file
|
exit 10
|
||||||
|
else
|
||||||
|
echo -n "Removing old files"
|
||||||
|
rm /var/run/autofs/automount_files.pid
|
||||||
fi
|
fi
|
||||||
;;
|
fi
|
||||||
nis)
|
echo -n "Starting automount for local auto.master"
|
||||||
ypcat -k auto.master 2>/dev/null| initmount nis yp
|
automount -v -p /var/run/autofs/automount_files.pid -t $TIMEOUT /etc/sysconfig/auto.master
|
||||||
;;
|
evaluate_retval
|
||||||
default)
|
fi
|
||||||
echo "no such source for automount: "$MOUNTSOURCE
|
if grep automount /etc/nsswitch.conf|grep -q nis; then
|
||||||
esac
|
if [ -f /var/run/autofs/automount_nis.pid ]; then
|
||||||
done
|
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
|
fi
|
||||||
;;
|
;;
|
||||||
stop)
|
stop)
|
||||||
|
if [ -f /var/run/autofs/automount_files.pid ]; then
|
||||||
|
if ps -ef|awk '{print $2}'|grep -q `cat /var/run/autofs/automount_files.pid`; then
|
||||||
echo -n "shutting down autofs"
|
echo -n "shutting down autofs"
|
||||||
pkill automount
|
kill `cat /var/run/autofs/automount_files.pid`
|
||||||
evaluate_retval
|
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
|
||||||
|
20
etc/init/autofs-nis.conf
Normal file
20
etc/init/autofs-nis.conf
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
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
|
20
etc/init/autofs.conf
Normal file
20
etc/init/autofs.conf
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
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
|
@ -1,19 +1 @@
|
|||||||
#!/bin/bash
|
3
|
||||||
#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
|
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
|
||||||
|
if [ -d /var/install/sysvinit* ]; then
|
||||||
WDIR=`pwd`
|
WDIR=`pwd`
|
||||||
cd etc/init.d
|
cd etc/init.d
|
||||||
chmod 755 autofs
|
chmod 755 autofs
|
||||||
@ -37,3 +38,4 @@ for i in 2 3 4 5; do
|
|||||||
cd ..
|
cd ..
|
||||||
done
|
done
|
||||||
cd $WDIR
|
cd $WDIR
|
||||||
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user