diff options
author | Donny Davies <woodchip@gentoo.org> | 2002-02-02 05:35:05 +0000 |
---|---|---|
committer | Donny Davies <woodchip@gentoo.org> | 2002-02-02 05:35:05 +0000 |
commit | cf35bbe68f2e6390eda2eea902d190c6e378d989 (patch) | |
tree | 2122161c5d000db9901fbd09cc14e7c2c76b5097 /net-fs | |
parent | First version in portage. (diff) | |
download | historical-cf35bbe68f2e6390eda2eea902d190c6e378d989.tar.gz historical-cf35bbe68f2e6390eda2eea902d190c6e378d989.tar.bz2 historical-cf35bbe68f2e6390eda2eea902d190c6e378d989.zip |
Tweak initscript for timeouts. Closes bug #444.
Diffstat (limited to 'net-fs')
-rw-r--r-- | net-fs/autofs/ChangeLog | 7 | ||||
-rw-r--r-- | net-fs/autofs/files/autofs.rc6 | 26 |
2 files changed, 23 insertions, 10 deletions
diff --git a/net-fs/autofs/ChangeLog b/net-fs/autofs/ChangeLog index 69d4fc0ce8a2..3e55363fd038 100644 --- a/net-fs/autofs/ChangeLog +++ b/net-fs/autofs/ChangeLog @@ -1,6 +1,11 @@ # ChangeLog for net-fs/autofs # Copyright 2002 Gentoo Technologies, Inc.; Distributed under the GPL -# $Header: /var/cvsroot/gentoo-x86/net-fs/autofs/ChangeLog,v 1.1 2002/02/01 21:53:32 gbevin Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-fs/autofs/ChangeLog,v 1.2 2002/02/02 05:35:05 woodchip Exp $ + + 2 Feb 2002; Donny Davies <woodchip@gentoo.org> files/autofs.rc6 : + + Added patch, contributed through bugzilla (Bug #444), which supposedly fixes + problem with timeouts. Hope everything is OK now. *autofs-3.1.7-r2 (1 Feb 2002) diff --git a/net-fs/autofs/files/autofs.rc6 b/net-fs/autofs/files/autofs.rc6 index d8fd1a7337de..f2cadae8f759 100644 --- a/net-fs/autofs/files/autofs.rc6 +++ b/net-fs/autofs/files/autofs.rc6 @@ -1,7 +1,7 @@ #!/sbin/runscript # Copyright 1999-2002 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License, v2 or later -# $Header: /var/cvsroot/gentoo-x86/net-fs/autofs/files/autofs.rc6,v 1.1 2002/01/26 01:03:32 woodchip Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-fs/autofs/files/autofs.rc6,v 1.2 2002/02/02 05:35:05 woodchip Exp $ # rc file for automount using a Sun-style "master map". # We first look for a local /etc/auto.master, then a YP @@ -31,13 +31,14 @@ then -a x`echo "$map" | cut -c1` != 'x-' ] then map=`echo "/etc/$map" | sed -e 's:^/etc//:/:'` - options=`echo "$options" | sed -e 's/\(^\|[ \t]\)-/\1/g'` + timeout=`echo $options | sed --silent -e 's/\(.*\)\(--timeout=[0-9]\+\)\(.*\)/\2/g ; /--timeout=[0-9]\+/ p'` + options=`echo $options | sed -e 's/\(.*\)\(--timeout=[0-9]\+\)\(.*\)/\1\3/g ; s/\(^\|[ \t]\)-/\1/g'` if [ -x $map ]; then - echo "/usr/sbin/automount $dir program $map $options $localoptions" + echo "/usr/sbin/automount $timeout $dir program $map $options $localoptions" elif [ -f $map ]; then - echo "/usr/sbin/automount $dir file $map $options $localoptions" + echo "/usr/sbin/automount $timeout $dir file $map $options $localoptions" else - echo "/usr/sbin/automount $dir `basename $map` $options $localoptions" + echo "/usr/sbin/automount $timeout $dir `basename $map` $options $localoptions" fi fi done @@ -63,7 +64,7 @@ then options=`echo "$options" | sed -e ' s/--*t\(imeout\)*[ \t]*[0-9][0-9]*//g s/\(^\|[ \t]\)-/\1/g'` - echo "/usr/sbin/automount $dir yp $map $options $localoptions" + echo "/usr/sbin/automount $mountoptions $dir yp $map $options $localoptions" fi done ) @@ -72,17 +73,24 @@ fi start() { ebegin "Starting automounter" - getmounts | while read cmd mnt rest + getmounts | while read cmd timeout mnt rest do + #FIXME: this works but it really sucks + if echo $timeout|grep -v -- '--timeout' >/dev/null ; then + rest="$mnt $rest" + mnt="$timeout" + timeout="" + fi + echo -n " $mnt" pidfile=/var/run/autofs`echo $mnt | sed 's/\//./'`.pid start-stop-daemon --start --pidfile $pidfile --quiet \ - --exec /usr/sbin/automount -- $mnt $rest + --exec /usr/sbin/automount -- $timeout $mnt $rest # # Automount needs a '--pidfile' or '-p' option. # For now we look for the pid ourself. # - ps ax | grep "[0-9]:[0-9][0-9] /usr/sbin/automount $mnt" | ( + ps ax | grep "[0-9]:[0-9][0-9] /usr/sbin/automount $timeout \?$mnt" | ( read pid rest echo $pid > $pidfile echo "$mnt $rest" >> $pidfile |