Results 1 to 8 of 8

Thread: autofs executable map not working

  1. #1
    Join Date
    Apr 2008
    Beans
    32
    Distro
    Ubuntu 8.04 Hardy Heron

    Unhappy autofs executable map not working

    Hi all,

    I am having some difficulty lately setting up and executable map under ubuntu 12.04. I have tried a number of different ideas but nothing seems to work so I am just trying to make it simplistic and get a bash script to echo back the right parameters.

    My /etc/auto.master looks like this
    Code:
    /mnt/nfs    /etc/auto.disks
    and then the /etc/auto.disks looks like this:
    Code:
    #!/bin/bash
    echo "listen  -rw ip:[share dir] "
    and then when I run cd /mnt/nfs/listen I get this:
    Code:
    bash: cd: /mnt/nfs/listen: No such file or directory
    Ideas?

  2. #2
    Join Date
    Feb 2009
    Location
    Dallas, TX
    Beans
    6,836
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: autofs executable map not working

    Hi TheKeyMaker.

    /etc/auto.disks should hold a map for the automounter, not a shell script.

    Check the format of both the master and the linked files by running:
    Code:
    man auto.master
    Regards.

  3. #3
    Join Date
    Apr 2008
    Beans
    32
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: autofs executable map not working

    thanks papibe, I like your picture!

    anyways you should be able to user a shell script. it is outlines in a number of examples like this site:

    http://docs.oracle.com/cd/E19963-01/...srefer-75.html

  4. #4
    Join Date
    Feb 2009
    Location
    Dallas, TX
    Beans
    6,836
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: autofs executable map not working

    Quote Originally Posted by TheKeyMaker View Post
    thanks papibe, I like your picture!
    Thanks.

    Quote Originally Posted by TheKeyMaker View Post
    you should be able to user a shell script. it is outlines in a number of examples like this site: http://docs.oracle.com/cd/E19963-01/...srefer-75.html
    Oopsy

    You are right. I've used autofs for years, and I didn't know, thanks!

    Try this:

    First, confirm the server path:
    Code:
    showmount -d yourserver
    The output should be something like:
    Code:
    Directories on yourserver:
    /path/to/share
    Code:
    #!/bin/bash
    echo "listen  -fstype=nfs,rw  yourserver:/path/to/share"
    Let us know how it goes.
    Regards.

  5. #5
    Join Date
    Apr 2008
    Beans
    32
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: autofs executable map not working

    Yeah that seems ok...

    Here is all the output.

    Code:
    user$ showmount -d [ip of server]
    /share/media/glance
    /share/media/watch
    So these are the two directories that I am sharing

    Code:
    user$ less /etc/auto.master
    /mnt/nfs    /etc/auto.disks --ghost

    Code:
    user$ less /etc/auto.disks
    #!/bin/bash
    echo " watch -fstype=nfs,rw  [ip of server]:/share/media/watch "
    Permisions:

    Code:
    user$ ls -al /etc/auto.*
    -rwxrwxrwx 1 root root   77 Aug  1 21:27 /etc/auto.disks
    -rw-r--r-- 1 root root   38 Aug  1 21:28 /etc/auto.master
    -rw-r--r-- 1 root root  660 Mar 22 06:21 /etc/auto.master.ucf-dist
    -rw-r--r-- 1 root root  524 Mar 22 06:21 /etc/auto.misc
    -rwxr-xr-x 1 root root 1374 Mar 22 06:21 /etc/auto.net
    -rwxr-xr-x 1 root root  687 Mar 22 06:21 /etc/auto.smb
    as you can see I decided to set the permisions to chmod 777 to make sure that it wasn't a permisons issue and that everyone would be able to execute it. I get the same results as before.

    I can mount it fine manually doing the following:

    Code:
    mount [ip of server]:/share/media/watch /mnt/nfs

  6. #6
    Join Date
    Apr 2008
    Beans
    32
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: autofs executable map not working

    Have still been trying other ideas, but nothing seems to work.
    Doesn't autofs log to a log file somewhere? I forget off hand.
    Would it send an error message to the logs if it can't mount the
    location?

  7. #7
    Join Date
    Feb 2009
    Location
    Dallas, TX
    Beans
    6,836
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: autofs executable map not working

    I tested it on my on system, and it actually works following the Oracle syntax:
    Code:
    #!/bin/bash
    [[ "$1" == "watch" ]] && echo "-fstype=nfs,rw  yourserver:/share/media/watch"
    Let's know how it goes.
    Regards.
    Last edited by papibe; August 2nd, 2012 at 10:37 PM. Reason: update line to include actual nfs share name

  8. #8
    Join Date
    Apr 2008
    Beans
    32
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: autofs executable map not working

    Quote Originally Posted by papibe View Post
    I tested it on my on system, and it actually works following the Oracle syntax:
    Code:
    #!/bin/bash
    [[ "$1" == "watch" ]] && echo "-fstype=nfs,rw  yourserver:/share/media/watch"
    Let's know how it goes.
    Regards.
    Yes!! That did work, but there is one last part that is missing.
    I have to say that autofs seems a little more buggy when you add this option.

    When I add the --ghost option and restart autofs it doesn't show the directory watch. I did find after playing around with it that it does show the directory after I mount it sucessfully once, but then it fails to run the script after I umount and try and remount it again.

    I will have to play around with this some more this weekend and let you know how it goes. Hopefully I can get it all working and consistent.


    Thanks again papibe!! You have move me closer in the right direction!

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •