Comment 46 for bug 211631

Revision history for this message
Fabri Velas (fabrivelas) wrote : Re: CIFS/SMBFS shares not unmounted before network is shut down

The best solution to avoid messing up the unmounting issue for special cases as described by Reinhard Tartler 5 posts ago is to use a special unmounting script for cifs. People who have used the workaround described by luchio have never used such a special case scenario. Therefore it is much more prudent to leave the present scrips as they are and introduce a new script for cifs. This solution has been proposed before by Sander Marechal. Here is a link to the description of the solution and the script: http://www.jejik.com/articles/2007/07/automatically_mounting_and_unmounting_samba_windows_shares_with_cifs/
It says there: "To solve it I [Sander Marechal] wrote a little script cobbled together from bits and pieces of the umountnfs.sh and sendsigs init scripts. Basically it makes a list of all your mounted CIFS filesystems, shuts down and subsequently kills all processes that are still using those filesystems, and finally unmounts the CIFS filesystems. Save it to /etc/init.d/umountcifs and make it executable. Then symlink to it from /etc/rc0.d and /etc/rc6.d. You should ensure that umountcifs runs before the K20* init scripts fire. If it runs at K20 or later, you will still get the error. Personally I symlinked from /etc/rc(0|6).d/K19umountcifs."
With this following update: "Neill Hogarth adds that for (K)ubuntu 7.10 the script should be symlinked as K12umountcifs. K19 seems to work on (K)ubuntu 7.04 and lower, and on Debian Etch."