Comment 3 for bug 24864

Revision history for this message
gpothier (gpothier) wrote :

Here is a workaround:
- add the following script (name it samba-shares) to /etc/init.d

---8<------------------------------
#!/bin/sh

PATH=/sbin:/bin:/usr/sbin:/usr/bin

start () {
 echo -n "Mounting samba shares"
 mount -a -t smbfs
 echo "."
}

stop () {
 echo -n "Unmounting samba shares"
 umount -l -a -t smbfs
 echo "."
}

case "$1" in
    start)
 start
    ;;

    stop)
 stop
    ;;

    restart)
 stop
 sleep 2
 start
    ;;

    *)
 echo "Usage: /etc/init.d/samba-shares {start|stop|restart}" >&2
 exit 1
    ;;
esac

exit 0
---8<------------------------------

- add the script to the list of services to stop during suspend (in /etc/default/acpi-support, in the STOP_SERVICES variable)

Doing this, samba shares are lazily unmounted before suspend, and remounted after resume. If there are open files on the share we have problems again... but otherwise it works fine.