It's unfortunate that people have to write custom scripts to unmount
CIFS shares, especially since .bash_logout doesn't seem to run in Ubuntu
9.10 for super-users. I fixed the problems by creating my own self-
healing wireless scripts to replace Network Manager and (as related to
the mounts, and it is not an ideal solution, because
/etc/gdm/PostSession/Default isn't run on shutdown and the system will
still hang if Network Manager is used):

For each user:
cd ~
mkdir network
cd network
mkdir archive p-$LOGNAME w-$LOGNAME
echo username=$LOGNAME >> p-$LOGNAME.pwd
chmod 600 p-$LOGNAME.pwd
echo password=somepasswd >> p-$LOGNAME.pwd
cp p-$LOGNAME.pwd w-$LOGNAME.pwd archive.pwd

exo-desktop-item-edit --create-new --type Application --name "User Directory 
Mount" --icon shares --command '/usr/local/bin/usr_mount' ~/.config/autostart/
  (Note: This is run instead of /etc/gdm/PostLogin/Default because that file 
runs as 'root' and not under the user account, so the mounts would not happen.)

mousepad ~/.gtk-bookmarks (replace $LOGNAME with the user's actual name)
    Add first line: file:///home/$LOGNAME/network/p-$LOGNAME  (this causes 
Places to use p-username)

sudo su root
echo >> /etc/fstab
echo //192.168.0.1/p-newUserName /home/newUserName/network/p-newUserName cifs 
noauto,nodfs,user,rw,credentials=/home/newUserName/network/p-newUserName.pwd 0 
0 >> /etc/fstab
(repeat 2nd line for each share)


The following is done once:

Add to /etc/gdm/PostSession/Default (because .bash_logout isn't run for a 
sudo-admin account):
# Unmount local volumes.
/usr/local/bin/usr_unmount


/usr/local/bin/usr_mount
for d in  `find ~/network -mindepth 1 -maxdepth 1 -type d`
do 
  case "${0##*/}" in
  usr_mount)
    echo "Mounting $d ..."
    mount $d
  ;;
  usr_unmount)
    echo "Unmounting $d ..."
    umount $d
  ;;
  *)
    echo "Unknown option: ${0##*/}"
  ;;
  esac
done


ln -s /usr/local/bin/usr_mount /usr/local/bin/usr_unmount

-- 
Network is brought down before network filesystems are unmounted (CIFS timeout 
at shutdown)
https://bugs.launchpad.net/bugs/211631
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to