Showing posts with label autofs. Show all posts
Showing posts with label autofs. Show all posts

Friday, September 21, 2012

Re-enabling autofs (aka automount) after Fedora 17 upgrade



$ sudo systemctl enable autofs.service
ln -s '/usr/lib/systemd/system/autofs.service' '/etc/systemd/system/multi-user.target.wants/autofs.service'
$ sudo systemctl start autofs.service

Modify auto.smb to avoid se-linux denial on root password request when auto-mounting smb shares

Change line ->
#opts="-fstype=cifs"
to ->
opts="-fstype=cifs,guest"

Tuesday, December 2, 2008

autofs #3

Ok, I weakened... again this isn't a pretty solution, and it seems NetworkManager is becoming my friend...

[user@localhost ~]$ cat /etc/NetworkManager/dispatcher.d/03-autofs
#!/bin/sh
if [ "$2" = "up" ]; then
AUTOFS=/etc/init.d/autofs

if [ ! -x $AUTOFS ]; then
exit 0
fi

$AUTOFS start > /dev/null
fi

Saturday, November 22, 2008

autofs #2

Well, I'm back from vacation... the Aspire One survived the journey well, it really is light and compact enough, that you can travel with it without noticing it. The biggest hassle was the lack of a 'global' WiFi network. In Amsterdam it costs you 10 euro's to log in... Melbourne down to $5, in Kuala Lumpur free. At cafe's and hotels a similar story, sometimes free, sometimes expensive... but you find yourself wondering is it worthwhile digging out the credit card. A 3G modem would in an ideal world avoid these hassles. In the real world, there's still the cost of global roaming, and the fact that UMTS hasn't yet completely replaced GSM. Occasionally you'll find yourself barely getting 10kbps.

Anyway back to autofs... two annoyances remain -
- I don't have a dns or mdns or zeroconfig solution on my home network
- On linpus, /etc/hosts is replaced at each boot
- autofs needs the hostname for my NAS (could be avoided using the IP address I guess)
- for some reason autofs isn't starting automatically, although chkconfig shows it configured

Well here's my somewhat ugly solution to the host name problem

[user@localhost ~]$ cat /etc/NetworkManager/dispatcher.d/02-hosts
#!/bin/bash
if [ "$2" = "up" ];
then
FOUND=`grep dlink-EEF76A /etc/hosts | wc -l`

if [ $FOUND = "0" ];
then
echo "Updating /etc/hosts"
DATE=`date`
echo "#updated by $0 at ${DATE}" >> /etc/hosts
echo "192.168.1.10 dlink-EEF76A" >> /etc/hosts
fi;
fi

Sunday, October 19, 2008

autofs

Install autofs (yum install autofs), then follow the link below
Auto-mounting the NAS using autofs -
Accessing Windows Or Samba Shares Using AutoFS
add an entry for the NAS in /etc/hosts

Something fundamental I've missed is that autofs gets the key on demand.
so -
[user@localhost ~]$ ll /cifs
total 0

which isn't promising... but

[user@localhost ~]$ ll /cifs/DLINK-EEF76A/
total 0
drwxrwxrwx 24 user user 0 2008-10-16 01:43 Volume_1
drwxr-xr-x 2 root root 0 2008-10-20 19:21 web_page

is what we want :)

A symbolic link simplifies access -
sudo ln -s /cifs/DLINK-EEF76A /mnt/nas