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
|
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
|
||||||
|
Loading…
Reference in New Issue
Block a user