Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

autofs and Slack 8.1

9 views
Skip to first unread message

GP

unread,
Jun 30, 2002, 10:22:23 PM6/30/02
to
Is autofs compiled in the default kernel of Slack 8.1 . If not, why? Are
there security concerns? I suppose nobody likes to mount/umount
unnecessarily.

GP
--
Eretz Israël, La Terre Promise
Avec Ariel Sharon, ses chars, ses F-16, ses hélicos Apache dans le rôle du
messie d'Israël
http://pages.infinit.net/mcrit/sionisme.html

Philippe BRUNOT

unread,
Jul 1, 2002, 5:48:20 AM7/1/02
to
Hello,

autofs is not compiled with kernel, but in a module loaded automatically.
I don't know anything about security concerns with autofs.

If you or someone need it, I can post my rc.autofs I fit to slack.

@++
phil


"GP" <gi...@spamMEnot.videotron.ca> a écrit dans le message de news:
d0PT8.1714$w54.2...@weber.videotron.net...

GP

unread,
Jul 1, 2002, 9:38:47 AM7/1/02
to
Philippe BRUNOT wrote:

> Hello,
>
> autofs is not compiled with kernel, but in a module loaded automatically.
> I don't know anything about security concerns with autofs.

Well, there seems to be some. In which occasions, I don't know:

NOTE: You also should consider any security hazards about using autofs.
http://www.linuxgazette.com/issue42/nielsen.html



> If you or someone need it, I can post my rc.autofs I fit to slack.

Why not? It seems automount has to be installed too? What's the whole
picture to read cd and disquettes without manually mounting them?

GP

unread,
Jul 1, 2002, 2:45:46 PM7/1/02
to
BTW I use a pretty old version of KDE (2.1.2), but it seems that, nowadays,
you don't have to mount cds and floppies in order to read them in KDE. So
that autofs would be only for access to your computer in remote mode.

If such is the case, I couldn't care less about autofs: I don't intend to
access my computer from remote locations and idon't mind typing "mount"
while I'm working at the prompt.

So this just might be a non-issue... for me.

Udi Kalifon

unread,
Jul 2, 2002, 7:59:36 AM7/2/02
to
Hi.

Which module is it we need to load into the kernel (modprobe
something)? And I would love it if you can post your rc.autofs, and
maybe also a basic configuration to auto-mount the cdrom?

Thanks.


"Philippe BRUNOT" <ne...@philb.net> wrote in message news:<afp8bs$giv$1...@wanadoo.fr>...

Philippe BRUNOT

unread,
Jul 2, 2002, 1:59:06 PM7/2/02
to
Hi,

at the end, you'll find a complete rc.autofs. copy and paste it in
/etc/rc.d/rc.autofs

you'll need to be root...
put this file in /etc/rc.d/
and execute
chmod +x /etc/rc.d/rc.autofs
then add these lines in /etc/rc.d/rc.local:
# starting autofs
if [ -x /etc/rc.d/rc.autofs ]; then
/etc/rc.d/rc.autofs start
fi

create a /misc directory:
mkdir /misc

create a file /etc/auto.master and copy & paste lines below:
## -- /etc/auto.master -- BEGIN
# $Id: auto.master,v 1.2 1997/10/06 21:52:03 hpa Exp $
# Sample auto.master file
# Format of this file:
# mountpoint map options
# For details of the format look at autofs(8).
/misc /etc/auto.misc
## -- /etc/auto.master -- END

create a file /etc/auto.misc and copy & paste lines below: (correct the
devices!! (depending your system)
## -- /etc/auto.misc -- BEGIN
# $Id: auto.misc,v 1.2 1997/10/06 21:52:04 hpa Exp $
# 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
cdrom -fstype=iso9660,ro :/dev/hdc
floppy -fstype=auto :/dev/fd0
sda1 -fstype=auto :/dev/sda1
backup_40G -fstype=auto :/dev/hdb1
iwa_home -fstype=nfs iwa:/home
xserverftp -fstype=nfs xserver:/mnt/ftp

## -- /etc/auto.misc -- END

remoot your system, or type:
/etc/rc.d/rc.autofs start
or stop if you want to shutdown autofs
the devices you configured in the file auto.misc are now available under
/misc.
(maybe you can't view thme with ls...)
on the 3 computer I use autofs, the module load automatically... if not,
type
modprobe autofs (add it in rc.local, if you need)

Next, you can create soft link in /mnt/ (remove first existing directory,
be carefull they are NOT nounted!!!!!)

ln -s /misc/cdrom /mnt/cdrom
ln -s /misc/xserverftp /mnt/ftp
ln -s /misc/backup_40G /mnt/backup
ln -s /misc/floppy /mnt/floppy
....

That's all !
I have configured rc.autofs to unmount automatically device after 60 seconds
(see timeout variable in rc.autofs)
I recomand you never remove an cdrom or floppy disk while it's not unmounted
!!!
be carefull, autofs, is not supermount (like you can find in Mandrake):
supermount sync data, as soon as you do not need the device... autofs sync
data when it unmount device.
(I'm not sure, but I think)
and, something else: I didn't succeed to use autofs like automount for nfs
volumes... (/net/nfsserver/share/directory)

Hope this can help,

@++
phil

######################################################
# -- /etc/rc.autofs -- BEGIN
######################################################
#! /bin/bash
#
# $Id: rc.autofs.in,v 1.4 2000/01/22 22:17:34 hpa Exp $
#
# rc file for automount using a Sun-style "master map".
# We first look for a local /etc/auto.master, then a YP
# map with that name
#
# On most distributions, this file should be called:
# /etc/rc.d/init.d/autofs or /etc/init.d/autofs
#

FLAGS="defaults 21"

#
# Location of the automount daemon and the init directory
#
DAEMON=/usr/sbin/automount
initdir=@@initdir@@
timeout=60

#
# Determine which kind of configuration we're using
#
system=unknown
if [ -f /etc/slackware-version ]; then
system=slackware
else
echo "$0: Unknown system, please port and contact
aut...@linux.kernel.org" 1>&2
exit 1
fi


test -e $DAEMON || exit 0
thisscript="$0"
if [ ! -f "$thisscript" ]; then
echo "$0: Cannot find myself" 1>&2
exit 1
fi

PATH=/sbin:/usr/sbin:/bin:/usr/bin
export PATH

#
# We can add local options here
# e.g. localoptions='rsize=8192,wsize=8192'
#
localoptions=''

#
# This function will build a list of automount commands to execute in
# order to activate all the mount points. It is used to figure out
# the difference of automount points in case of a reload
#
function getmounts()
{
#
# Check for local maps to be loaded
#
if [ -f /etc/auto.master ]
then
cat /etc/auto.master | sed -e '/^#/d' -e '/^$/d'| (
while read dir map options
do
if [ ! -z "$dir" -a ! -z "$map" \
-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'`
if [ -x $map ]; then
echo "$DAEMON $dir program $map $options $localoptions"
elif [ -f $map ]; then
echo "$DAEMON -t $timeout $dir file $map $options
$localoptions"
else
echo "$DAEMON $dir `basename $map` $options
$localoptions"
fi
fi
done
)
fi

#
# Check for YellowPage maps to be loaded
#
if [ -e /usr/bin/ypcat ] && [ `ypcat -k auto.master 2>/dev/null | wc -l` -gt
0 ]
then
ypcat -k auto.master | (
while read dir map options
do
if [ ! -z "$dir" -a ! -z "$map" \
-a x`echo "$map" | cut -c1` != 'x-' ]
then
map=`echo "$map" | sed -e 's/^auto_/auto./'`
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'`
echo "$DAEMON $dir yp $map $options $localoptions"
fi
done
)
fi
}

#
# Status lister.
#
function status()
{
echo "Configured Mount Points:"
echo "------------------------"
getmounts
echo ""
echo "Active Mount Points:"
echo "--------------------"
ps ax|grep "[0-9]:[0-9][0-9] automount " | (
while read pid tt stat time command; do echo $command; done
)
}

#
# Slackware start/stop function.
#
function slackware()
{

#
# See how we were called.
#
case "$1" in
start)
# Check if the automounter is already running?
if [ ! -f /var/lock/subsys/autofs ]; then
echo 'Starting automounter: '
getmounts | sh
touch /var/lock/subsys/autofs
fi
;;
stop)
kill -TERM $(/sbin/pidof /usr/sbin/automount)
rm -f /var/lock/subsys/autofs
;;
reload|restart)
if [ ! -f /var/lock/subsys/autofs ]; then
echo "Automounter not running"
exit 1
fi
echo "Checking for changes to /etc/auto.master ...."
TMP1=`mktemp /tmp/autofs.XXXXXX` || { echo "could not make temp
file" >& 2; exit 1; }
TMP2=`mktemp /tmp/autofs.XXXXXX` || { echo "could not make temp
file" >& 2; exit 1; }
getmounts >$TMP1
ps ax|grep "[0-9]:[0-9][0-9] automount " | (
while read pid tt stat time command; do
echo "$command" >>$TMP2
if ! grep -q "^$command" $TMP2; then
kill -USR2 $pid
echo "Stop $command"
fi
done
)
cat $TMP1 | ( while read x; do
if ! grep -q "^$x" $TMP2; then
$x
echo "Start $x"
fi
done )
rm -f $TMP1 $TMP2
;;
status)
status
;;
*)
echo "Usage: $initdir/autofs {start|stop|restart|reload|status}"
exit 1
esac
}

if [ $system = slackware ]; then
slackware "$@"
fi
exit 0

######################################################
# -- /etc/rc.autofs -- END
######################################################


"Udi Kalifon" <udika...@excite.com> a écrit dans le message de news:
d1b8e9c5.02070...@posting.google.com...

0 new messages