LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 04-20-2004, 03:02 AM   #1
fitteschleiker
LQ Newbie
 
Registered: Feb 2004
Location: perth, australia
Distribution: slackware
Posts: 22

Rep: Reputation: 15
autofs


i want to use autofs to automatically mount my cdrom and floppy when i insert them

is this possible? it would also be nice to have a cdrom icon come up on my kde desktop when i insert the cd, does anyone know a way to do this?

my rc.autofs is such:

#!/bin/bash
#
# Slackware rc file for automount (file type maps only)
# Severely handicapped rc.autofs.in from autofs-3.1.7 package
# Andrei Osin <osin@izmiran.ru>
#
# In Slackware, this file should be called:
# /etc/rc.d/rc.autofs

if [ ! -f /etc/slackware-version ]; then
echo "This is not a Slackware system" 1>&2
exit 1
fi

#
# Location of the automount daemon
#

DAEMON=`whereis -b automount|cut -d' ' -f2`
test -e $DAEMON || exit 1

# Additional map options
localoptions=''

# This function will build a list of automount commands to execute in
# order to activate all the mount points.

function getmounts()
{
#
# Check for local maps to be loaded
#
if [ -f /etc/auto.master ]
then
cat /etc/auto.master | sed -e '/^#/d' -e '/^$/d'| (
# These are automount options
while read dir map options
do
if [ -f $map ]; then
echo "$DAEMON $options $dir file $map $localoptions"
fi
done
)
fi
}

#
# Status lister.
#
function status()
{
test `ps ax|grep -c automount` -eq 0 &&
echo Automount is not running &&
exit
echo "Configured Mount Points:"
echo "------------------------"
getmounts | cut -d' ' -f3
echo ""
echo "Active Mount Points:"
echo "--------------------"
getmounts | cut -d' ' -f3 | while read dir
do
mount | grep -v automount | grep $dir | cut -d' ' -f3
done
}

case "$1" in
start)
# Check if the automounter is already running?
if [ ! -f /var/lock/subsys/autofs ]; then
echo 'Starting automounter: '
getmounts | cut -d' ' -f3
getmounts | sh
touch /var/lock/subsys/autofs
fi
;;
stop)
kill -TERM $(/sbin/pidof $DAEMON)
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] $DAEMON " | (
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: $0 {start|stop|restart|reload|status}"
exit 1
esac

exit 0


and my auto.master:

# Sample auto.master file
# Format of this file:
# mountpoint map options
# For details of the format look at autofs(8).

/mnt/auto /etc/auto.misc --timeout=3

and my auto.misc:

# 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,user,ro :/dev/cdrom
floppy -fstype=vfat,user,iocharset=koi8-r :/dev/fd0


i was under the impression that this was all that was required to get it to mount cds and floppies upon insertion, oh yes of course with starting it in rc.local of course

rc.local:

#!/bin/sh
#
# /etc/rc.d/rc.local: Local system initialization script.
#
# Put any local setup commands in here:
automount --timeout=3 /mnt/auto file /etc/auto.misc




anyone?
 
Old 06-28-2005, 04:11 PM   #2
RoaCh Of DisCor
Member
 
Registered: Apr 2004
Location: Washington State
Distribution: SuSE 9.3 / Slackware-Current
Posts: 701

Rep: Reputation: 30
I want to set up AUTOfs. Not sure where to begin. Could someone possibly help me, or direct me to a easy to understand howto
 
Old 06-28-2005, 04:17 PM   #3
egag
Senior Member
 
Registered: Jul 2004
Location: Netherlands
Distribution: Slackware
Posts: 2,721

Rep: Reputation: 53
read down from this post ( howto setup autofs ) :

http://www.linuxquestions.org/questi...74#post1618674

egag
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
autofs kemkem42 Linux - Software 1 09-22-2005 01:22 PM
Autofs tefal Linux - Software 4 07-20-2004 10:58 AM
Using Autofs guygriffiths Linux - Software 1 09-17-2003 10:31 AM
Autofs...help please yourcompadre Linux - Networking 0 06-03-2003 09:07 PM
Please help! autofs foetus66 Linux - General 1 03-25-2003 07:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 11:51 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration