Results 1 to 8 of 8

Thread: Scripting problem: stopping automount

  1. #1

    Scripting problem: stopping automount

    Is there any way i can stop RedHat 7.x from automounting a cd when it is inserted? I need to do this from the command line (in a script) and not by changing RedHat settings from the gui. The problem occurs when my script tries to unmount the cdrom after the automount window has popped up and i get a message saying that the device is still busy (because the window is open). Any suggestions? *??? Thanks a ton for any help you can provide!


    PS: Is a new process opened when that window pops up (from the cd being automounted)? I tried doing a
    ps -A > temp1 ##before the cd was automounted
    and then a
    ps -A > temp2 ## after the cd was automounted
    and then i did a
    diff temp1 temp2
    and found no new processes... else i woul have just killed the new process.

  2. #2

    Re: Scripting problem: stopping automount

    Just to provide some more information... Ive tried deleting the line for the cdrom in the /etc/auto.misc file and then reloading /etc/init.d/autofs script but any cds I insert still automount. It looks like all the info is in the man pages but i dont understand it Ive read through it a few times and im getting nowhere. Help! (Please!)

  3. #3

    Re: Scripting problem: stopping automount

    I don't use automount myself, but I can see you are desperate . Are you not able to disable the daemon altogether? (maybe just doing "/etc/init.d/autofs stop" will do that).

    Also, it may not be the reason that you can't unmount. If your script changes to a directory on the cd it will have to change to a different "off cd" directory before it can umount as the cd is still in use if it is the present working directory of any shell.

  4. #4

    Re: Scripting problem: stopping automount

    I typed this:
    /etc/init.d/autofs stop
    and got this:
    Stopping automounter: * * * * * * * * * * * * * * * * *[FAILED]
    And yes, i agree that the reason i cant unmount the cd with that window up is because it is looking at the contents of the cd. But i need my script to do all of this, and not have the user close the window or change to a different directory. I need a way for my script to supress that window from coming up. Its not so much that i dont want it to automount, i can get around that rather easily, i need to keep that cursed window from popping up and i was assuming that if i could disable automount it would disable that window from coming out. I now realize there could be some error in my big assumption though.... when i mount the cd manually that window still pops up. So now my question has evolved to "How do i keep that window from popping up when a cd is mounted?" Thanks again for any help you can provide!

    Edit: I just reread your last post Pam and i see what you are saying now. No, im not cd'd to a a directory on the cd. The only thing i do is an:
    if ls /mnt/cdrom/linux/manager
    to see if the correct cd was inserted and then an
    rpm --install
    command. The reason i cant unmount the cd is because that window pops up displaying the contents of that cd... oh, that cursed... cursed window!

  5. #5

    Re: Scripting problem: stopping automount

    I got so bold as to "rpm -e autofs" in the /etc/init.d directory and that didnt even stop it from automounting! Think if i do an "rm -rf /etc/init.d" that will solve the problem? hehe
    --Morphman, losing it

  6. #6

    Re: Scripting problem: stopping automount

    I dunno then, maybe it's a property of your desktop environment to do this - maybe it listens for this event, maybe it's configurable somewhere.
    Try typing "lsof | grep cdrom" at the time that the device is supposedly busy (lsof = list open files, we are trying to find anything open with /mnt/cdrom in it's path). ???

  7. #7

    Re:Scripting problem: stopping automount

    what if you remove lines relating to 'cdrom' from /etc/fstab?

    Also, depending on the window manager, you can disable automounting through a gui once and it won't happen again. My guess is that you're using Nautilus, which is a huge pain in the a** in this respect. Whatever you're using, check out its 'control-panel' equivalent and see if you can find something there. If not, I'd get on a mailing list and ask there.

  8. #8

    Re:Scripting problem: stopping automount

    I just gave up on it. Its too much work for trying to save 3 seconds. We install on so many systems that it would totally negate anything i would gain from the script by making the user disable automount. Thanks for the help anyway guys!

Similar Threads

  1. Nis and nfs+automount
    By zawiy in forum Redhat / Fedora
    Replies: 0
    Last Post: 05-16-2010, 04:27 AM
  2. Stopping a Service with a .bat file?
    By cellis in forum Windows - General Topics
    Replies: 1
    Last Post: 10-24-2006, 05:49 AM
  3. Stopping IPtables on Debian
    By woosting in forum Security
    Replies: 7
    Last Post: 10-07-2005, 03:15 AM
  4. Starting and stopping daemons
    By Digital_Froggy in forum Linux - General Topics
    Replies: 3
    Last Post: 01-05-2002, 06:36 AM
  5. Automount with gnome
    By Schotty in forum Linux - Software, Applications & Programming
    Replies: 8
    Last Post: 01-02-2002, 03:56 AM


Posting Permissions

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