Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I want to umount NFS drive at shutdown/restart. I connect to it with my laptop, and due to known bug, the system shuts down for ten minutes, instead for 20 seconds, when the NFS is mounted. I used to umount it in MAverick with K02umount script in /etc/rc0.d and rc6.d but after the upgrade, it does not seem to work anymore. So, I try to write an upstart job, which will do it for me i tried

#start on stopping network

start on net-device-down IFACE!=lo  
task
# I tried with start on runlevel [!2345], too
script
exec /home/deckoff/Desktop/umount
end script

umount is

umount /media/MyBookLive

and will work OK, when executed manually It seems this i sneer executed on shutdown or restart. I want to find a way to find event, that will be early enough, so the script has enough execute. I read that the problem is because the network is down before unmount, so unmount is killed by timeout. I look for even that will happen before the network disconnect. Manually disconnecting actually does the trick...

Could this bug be actually responsible for my troubles?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

Since you need to communicate with the remote system, you actually are too late if you start on net-device-down.

The bug you mentioned, https://launchpad.net/bugs/672177 , which I fixed, has nothing to do with NFS, and is definitely not your issue.

You mentioned a "known bug" that makes your system take 10 minutes to shut down, were you referring to https://launchpad.net/bugs/211631 ?

If you can create and edit upstart jobs, you should be able to edit fstab. There is a specific script that is run during the shutdown just to unmount NFS filesystems at the best time. If it is taking 10 minutes thats a pretty big problem, and should be reported and escalated as a bug we should fix in Ubuntu. You can specify the 'noauto' flag and it will not be mounted at boot time, so you can still control it with 'mount' and only mount it when you want to.

Finally, you may want to just do your unmount in a script in /etc/network/if-pre-down.d .. I have never tried this, but at least it will run before the network interface is deconfigured, so you have a chance to close the connections and sync data properly. Read man 5 interfaces for more on that.

share|improve this answer
    
1) Thanx for answer 2) I came with this upstart.conf file which solves the problem for me : Pastebin link 3. It seems this is the bug you link to is the one I mean and have. Manual unmount solves the problem. 4) The error message I get is kernel needs Apparmor 2.4 compatbility patch (if that helps) How the heck I add a new line here –  deckoff May 26 '11 at 8:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.