automount in neuer version wesentlich naeher an sun. Das macht einen komplett neuen startup notwendig
git-svn-id: svn://svn.compuextreme.de/Viitor/V962/Viitor_autofs@5336 504e572c-2e33-0410-9681-be2bf7408885
This commit is contained in:
parent
005f9a360f
commit
5533591415
@ -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
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
if [ -f /etc/nsswitch.conf ]; then
|
||||
for MOUNTSOURCE in `grep automount /etc/nsswitch.conf | awk '{ $1=""; print; };'`; do
|
||||
case "$MOUNTSOURCE" in
|
||||
files)
|
||||
if [ -f /etc/sysconfig/auto.master ]; then
|
||||
cat /etc/sysconfig/auto.master| initmount files file
|
||||
if [ -f /etc/sysconfig/auto.master ] && grep automount /etc/nsswitch.conf|grep -q files; then
|
||||
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 "Automount already running"
|
||||
print_status failure
|
||||
exit 10
|
||||
else
|
||||
echo -n "Removing old files"
|
||||
rm /var/run/autofs/automount_files.pid
|
||||
fi
|
||||
;;
|
||||
nis)
|
||||
ypcat -k auto.master 2>/dev/null| initmount nis yp
|
||||
;;
|
||||
default)
|
||||
echo "no such source for automount: "$MOUNTSOURCE
|
||||
esac
|
||||
done
|
||||
fi
|
||||
echo -n "Starting automount for local auto.master"
|
||||
automount -v -p /var/run/autofs/automount_files.pid -t $TIMEOUT /etc/sysconfig/auto.master
|
||||
evaluate_retval
|
||||
fi
|
||||
if grep automount /etc/nsswitch.conf|grep -q nis; then
|
||||
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)
|
||||
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"
|
||||
pkill automount
|
||||
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)
|
||||
$0 stop
|
||||
|
Loading…
Reference in New Issue
Block a user