Raport z placu boju
1. wyszukałem coś takiego jak autofs.
NIE DZIAŁA
http://www.linuxquestions.org/questions ... id=1149234
- odpaliłem demona - /etc/rc.d/rc.autofs
Kod: Zaznacz cały
ps -ef |grep auto
root 7244 1 0 15:29 pts/3 00:00:00 /usr/sbin/automount --timeout=1 /media/usbpen file /etc/autofs.map
Kod: Zaznacz cały
cat /etc/autofs.conf
# For details of the format look at autofs(8).
# mountpoint map options # see also: man 8 autofs
/media/usbpen /etc/autofs.map --timeout=1
Kod: Zaznacz cały
cat /etc/autofs.map
# /etc/auto.map
# mountpoint_key options location_device # man 5 autofs
#cdrom0 -fstype=auto,ro,nosuid,nodev,user :/dev/cdrom
#floppy0 -fstype=auto,sync,dirsync,nosuid,nodev,noexec,user,gid=100,umask=000 :/dev/fd0
usb0 -fstype=auto,sync,dirsync,nosuid,nodev,noexec,user,gid=100,umask=000 :/dev/sda1
usb1 -fstype=auto,sync,dirsync,nosuid,nodev,noexec,user,gid=100,umask=000 :/dev/sdb1
usb2 -fstype=auto,sync,dirsync,nosuid,nodev,noexec,user,gid=100,umask=000 :/dev/sdc1
I po włożeniu pendrive nie dzieje się nic
/var/log/messages
Kod: Zaznacz cały
Apr 4 15:39:09 hannah kernel: hub.c: new USB device 00:10.4-1, assigned address 35
Zawartość /media/usbpen jest pusta.
Paczka autofs standardowa z S11
Plik rc.autofs jak i autofs.conf i map pochodzą z linuxpackages.
rc.autofs:
Kod: Zaznacz cały
cat /etc/rc.d/rc.autofs
#!/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>
#
# Adapted by Wanderson Santiago dos Reis <wandersonsreis (at) gmail dot com>
# for package autofs-config
#
# 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=`which automount`
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/autofs.conf ]; then
cat /etc/autofs.conf | 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
}
function autofs_reload()
{
if [ ! -f /var/lock/subsys/autofs ]; then
echo "Automounter not running..."
exit 1
fi
echo "Checking for changes to /etc/autofs.conf ..."
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
}
function autofs_start()
{
# Check if the automounter is already running?
if [ ! -f /var/lock/subsys/autofs ]; then
echo -n 'Starting automounter: '
echo -n
getmounts | cut -d' ' -f3
getmounts | sh
touch /var/lock/subsys/autofs
fi
autofs_reload
}
function autofs_stop()
{
if [ -f /var/lock/subsys/autofs ]; then
echo -n 'Stopping automounter: '
echo -n
getmounts | cut -d' ' -f3
kill -TERM $(/sbin/pidof $DAEMON) 1> /dev/null 2>&1
rm -f /var/lock/subsys/autofs 1> /dev/null 2>&1
else
echo "Automounter not running..."
fi
}
case "$1" in
start)
autofs_start
;;
stop)
autofs_stop
;;
reload)
autofs_reload
;;
status)
status
;;
*)
echo "Usage: $0 {start|stop|reload|status}"
exit 1
esac
exit 0
Co robię nie tak?
Czy ktoś z Was ma doświadczenie z autofs?
----
2. Znalazłem też coś takiego z regułkami udev.
http://archlinux.org/pipermail/arch/200 ... 06162.html
Czy mogę to zastosować?
/etc/rc.d/rc.udev mam +x, kernel 2.4.33-3
Jeśli tak, to gdzie należy je wpisać?