]> git.pld-linux.org Git - packages/autofs.git/commitdiff
efc5887f0c2b0df153d490cf6b9bc024 autofs-4.0.0pre6.tar.gz
authorwaszi <waszi@pld-linux.org>
Sat, 26 Feb 2000 09:16:51 +0000 (09:16 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
3f01e60586fe51b07fdc3fff01e34696  autofs-auto.master
5b60395b6c5b78fa56c274112075258a  autofs-auto.misc
445b150fa6d2fb77c0ad0639ded6485a  autofs-auto.mnt
f82862db3287e25b2c2b395384aeaa70  autofs-auto.net
0e94d3f426c3c4d474dc499fc4331328  autofs.init
038fd5c4d653aed344cb01008f9f48bd  autofs.patch

Changed files:
    autofs-auto.master -> 1.1
    autofs-auto.misc -> 1.1
    autofs-auto.mnt -> 1.1
    autofs-auto.net -> 1.1
    autofs.init -> 1.10

autofs-auto.master [new file with mode: 0644]
autofs-auto.misc [new file with mode: 0644]
autofs-auto.mnt [new file with mode: 0644]
autofs-auto.net [new file with mode: 0644]
autofs.init

diff --git a/autofs-auto.master b/autofs-auto.master
new file mode 100644 (file)
index 0000000..25a852f
--- /dev/null
@@ -0,0 +1,7 @@
+# $Id$
+# Sample auto.master file
+# Format of this file:
+# mountpoint map options
+# For details of the format look at autofs(8).
+/misc  auto.misc               --timeout 60
+/net   auto.net
diff --git a/autofs-auto.misc b/autofs-auto.misc
new file mode 100644 (file)
index 0000000..262c5bb
--- /dev/null
@@ -0,0 +1,13 @@
+# $Id$
+# This is an automounter map and it has the following format
+# key [ -mount-options-separated-by-comma ] location
+# Details may be found in the autofs(5) manpage
+
+kernel         -ro,soft,intr           ftp.kernel.org:/pub/linux
+cd             -fstype=iso9660,ro      :/dev/cdrom
+
+# the following entries are samples to pique your imagination
+#floppy                -fstype=auto            :/dev/fd0
+#floppy                -fstype=ext2            :/dev/fd0
+#e2floppy      -fstype=ext2            :/dev/fd0
+#jaz           -fstype=ext2            :/dev/sdc1
diff --git a/autofs-auto.mnt b/autofs-auto.mnt
new file mode 100644 (file)
index 0000000..27343fc
--- /dev/null
@@ -0,0 +1,14 @@
+# This is an automounter map and it has the following format
+# key [ -mount-options-separated-by-comma ] location
+# Details may be found in the autofs(5) manpage
+
+kernel         -ro                     ftp.kernel.org:/pub/linux
+cdrom          -fstype=iso9660,ro,nodev,nosuid :/dev/cdrom
+# Beware that popping out a floppy disc while it is mounted is a VERY
+# DANGEROUS OPERATION, and can result in disc corruption.  If you have
+# a floppy drive where this is possible (i.e. most PCs), you are warned!
+#floppy                -fstype=auto,nodev,nosuid       :/dev/fd0
+
+# The following are to give you some additional ideas
+#zip           -fstype=ext2            :/dev/hdc
+#jaz           -fstype=auto            :/dev/sda
diff --git a/autofs-auto.net b/autofs-auto.net
new file mode 100644 (file)
index 0000000..72914c3
--- /dev/null
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+# $Id$
+
+# Look at what a host is exporting to determine what we can mount.
+# This is very simple, but it appears to work surprisingly well
+
+key="$1"
+opts="-fstype=nfs,hard,intr,nodev,nosuid"
+
+# Showmount comes in a number of names and varieties.  "showmount" is
+# typically an older version which accepts the '--no-headers' flag
+# but ignores it.  "kshowmount" is the newer version installed with knfsd,
+# which both accepts and acts on the '--no-headers' flag.
+#SHOWMOUNT="kshowmount --no-headers -e $key"
+#SHOWMOUNT="showmount -e $key | tail +2"
+
+# Newer distributions get this right
+SHOWMOUNT="showmount --no-headers -e $key"
+
+$SHOWMOUNT | sort +0 | sed -e "s|^\([^         ]*\).*|$key\1 $opts $key:\1|"
index a7cd2a0e3f925b7575723546399b2454c476d82f..6bb58969e24c02e67da05772ef30f66a5eaae132 100644 (file)
 # Get network config
 . /etc/sysconfig/network
 
-# Get service config
-[ -f /etc/sysconfig/inetd ] && . /etc/sysconfig/inetd
-
 # Check that networking is up.
 if [ "${NETWORKING}" = "no" ]; then
        echo "WARNING: Networking is down. Autofs service can't be runed."
        exit 1
 fi
 
+DAEMON=usr/sbin/automount
 
 #      We can add local options here
 #      e.g. localoptions='rsize=8192,wsize=8192'
@@ -42,7 +40,7 @@ localoptions=''
 getmounts()
 {
 #
-#      Check for local maps to be loaded
+# Check for local maps to be loaded
 #
 if [ -f /etc/autofs/auto.master ]
 then
@@ -52,22 +50,14 @@ then
            if [ ! -z "$dir" -a ! -z "$map" \
                        -a x`echo "$map" | cut -c1` != 'x-' ]
            then
-               map=`echo "/etc/autofs/$map" | sed -e 's:^/etc/autofs/:/:'`
-               # special: treat -t or --timeout (or any reasonable derivative)
-               # specially, since it can't be made a normal mount option.
-               if echo $options | grep -- '-t' >/dev/null 2>&1 ; then
-                   mountoptions="--timeout $(echo $options | \
-                     sed 's/^.*-t\(imeout\)*[ \t]*\([0-9][0-9]*\).*$/\2/g')"
-               fi
-               options=`echo "$options" | sed -e '
-                 s/--*t\(imeout\)*[ \t]*[0-9][0-9]*//g
-                 s/\(^\|[ \t]\)-/\1/g'`
+               map=`echo "/etc/autofs/$map" | sed -e 's:^/etc\/autofs//:/:'`
+               options=`echo "$options" | sed -e 's/\(^\|[ \t]\)-/\1/g'`
                if [ -x $map ]; then
-                   echo "/usr/sbin/automount $mountoptions $dir program $map $options $localoptions"
+                   echo "$DAEMON $daemonoptions $dir program $map $options $localoptions"
                elif [ -f $map ]; then
-                   echo "/usr/sbin/automount $mountoptions $dir file $map $options $localoptions"
+                   echo "$DAEMON $daemonoptions $dir file $map $options $localoptions"
                else
-                   echo "/usr/sbin/automount $mountoptions $dir `basename $map` $options $localoptions"
+                   echo "$DAEMON $daemonoptions $dir `basename $map` $options $localoptions"
                fi
            fi
        done
@@ -75,7 +65,7 @@ then
 fi
 
 #
-#      Check for YellowPage maps to be loaded
+# Check for YellowPage maps to be loaded
 #
 if [ -e /usr/bin/ypcat ] && [ `ypcat -k auto.master 2>/dev/null | wc -l` -gt 0 ]
 then
@@ -90,10 +80,10 @@ then
                    mountoptions="--timeout $(echo $options | \
                      sed 's/^.*-t\(imeout\)*[ \t]*\([0-9][0-9]*\).*$/\2/g')"
                fi
-               options=`echo "$options" | sed -e '
-                 s/--*t\(imeout\)*[ \t]*[0-9][0-9]*//g
-                 s/\(^\|[ \t]\)-/\1/g'`
-               echo "/usr/sbin/automount $mountoptions $dir yp $map $options $localoptions"
+                options=`echo "$options" | sed -e '
+                  s/--*t\(imeout\)*[ \t]*[0-9][0-9]*//g
+                  s/\(^\|[ \t]\)-/\1/g'`
+               echo "$DAEMON $daemonoptions $mountoptions $dir yp $map $options $localoptions"
            fi
        done
     )
@@ -109,9 +99,11 @@ case "$1" in
        if [ ! -f /var/lock/subsys/automount ]; then
                show Starting automounter
                busy
-               getmounts | sh
-               deltext
-               ok
+               if getmounts | sh; then
+                   deltext;ok
+               else
+                   deltext;ok
+               fi
        else
            echo "automount already is running"
        fi
This page took 0.042188 seconds and 4 git commands to generate.