Slow Shutdown when Network Mgr closes before CIFS unmounted
On Sat, 16 Jan 2010 10:44:04 +1100
David Collins <david.8.collins@gmail.com> wrote: > I am working on a fairly well-known ongoing problem where you have a slow > logoff if connected wirelessly to a Samba share. > You get the message 'CIFS VFS: No response ...' and it takes about 2 minutes > for the laptop to shutdown. > Apparently it happens because Network Manager closes down before the CIFS > mounts are unmounted. Well, that's quite a coincidence, I just ran into this bug a few days ago (before this week I didn't have a samba share in my local network that I wanted to automount). Would be great if there could be at least a workaround in Xubuntu - if you need help with testing, I'm here. Cheers, Simon -- xubuntu-devel mailing list xubuntu-devel@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/xubuntu-devel |
Slow Shutdown when Network Mgr closes before CIFS unmounted
On Fri, 15 Jan 2010 17:53:31 -0700
"Sandahl *" <sandahlb@gmail.com> wrote: > Are there any plans to replace Network Manager with Wicd?* *I have > always found it much easier to set up networking with Wicd. > > B. Sandahl > > http://wicd.sourceforge.net/ > > On Fri, Jan 15, 2010 at 4:44 PM, David Collins > <david.8.collins@gmail.com>wrote: > > > Hello, > > > > I am working on a fairly well-known ongoing problem where you have > > a slow logoff if connected wirelessly to a Samba share. > > You get the message 'CIFS VFS: No response ...' and it takes about 2 > > minutes for the laptop to shutdown. > > Apparently it happens because Network Manager closes down before > > the CIFS mounts are unmounted. > > > > It will probably be some time before this gets fixed at the root > > cause but there is a good work-around for Gnome. > > It entails running a process in the Gnome session that waits for the > > 'save-yourself' event (see below). > > > > Is there a similar closing-down event that can be hooked into with > > an XFCE session ? > > Would anyone be able to supply the few lines of code required in > > main() below ? > > I could then test and, if successful, post the solution back into > > the Ubuntu forums article below. > > > > #!/usr/bin/env python > > > > #Author: Seamus Phelan > > # http://ubuntuforums.org/showthread.php?p=8451352#post8451352 > > > > #This program runs a custom command/script just before gnome shuts > > #down. This is done the same way that gedit does it (listening for > > #the 'save-yourself' event). This is different to placing scipts > > #in /etc/rc#.d/ as the script will be run before gnome exits. > > #If the custom script/command fails with a non-zero return code, a > > #popup dialog box will appear offering the chance to cancel logout > > # > > #Usage: 1 - change the command in the 'subprocess.call' in > > # function 'session_save_yourself' below to be what ever > > # you want to run at logout. > > # 2 - Run this program at every gnome login (add via menu > > System # -> Preferences -> Session) > > # > > # > > > > import sys > > import subprocess > > import datetime > > > > import gnome > > import gnome.ui > > import gtk > > > > class Namespace: pass > > ns = Namespace() > > ns.dialog = None > > > > def main(): > > prog = gnome.init ("gnome_save_yourself", "1.0", > > gnome.libgnome_module_info_get(), sys.argv, []) > > client = gnome.ui.master_client() > > #set up call back for when 'logout'/'Shutdown' button pressed > > client.connect("save-yourself", session_save_yourself) > > client.connect("shutdown-cancelled", shutdown_cancelled) > > > > def session_save_yourself( *args): > > #Unmount those CIFS shares! > > retcode = subprocess.call("sudo /etc/init.d/umountnfs.sh", > > shell=True) if retcode != 0: > > #command failed > > show_error_dialog() > > return True > > > > def shutdown_cancelled( *args): > > if ns.dialog != None: > > ns.dialog.destroy() > > return True > > > > def show_error_dialog(): > > ns.dialog = gtk.Dialog("There was a problem running your > > pre-shutdown script", > > None, > > gtk.DIALOG_MODAL | > > gtk.DIALOG_DESTROY_WITH_PARENT, > > ("There was a problem running your > > pre-shutdown script - continue logout", gtk.RESPONSE_ACCEPT)) > > if ns.test_mode == True: > > response = ns.dialog.run() > > ns.dialog.destroy() > > else: > > #when in shutdown mode gnome will only allow you to open a > > window using master_client().save_any_dialog() > > #It also adds the 'Cancel logout' button > > gnome.ui.master_client().save_any_dialog(ns.dialog ) > > > > #Find out if we are in test mode??? > > if len(sys.argv) >=2 and sys.argv[1] == "test": > > ns.test_mode = True > > else: > > ns.test_mode = False > > > > if ns.test_mode == True: > > main() > > session_save_yourself() > > else: > > main() > > gtk.main() > > > > Regards, > > David Collins > > > > > > -- > > xubuntu-devel mailing list > > xubuntu-devel@lists.ubuntu.com > > https://lists.ubuntu.com/mailman/listinfo/xubuntu-devel > > > > I proposed that not long ago but was shot down for the following reasons: 1) No built in VPN support 2) The gui isn't pretty enough Hopefully WICD fixes these issues (although I like the current GUI) so we can finally boot network manager for good. - J -- xubuntu-devel mailing list xubuntu-devel@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/xubuntu-devel |
Slow Shutdown when Network Mgr closes before CIFS unmounted
I have installed WICD and this does not fix the problem.
The pre-disconnection script setting looked promising but this only runs when you manually disconnect from the wireless network - not when the XFCE session shuts down. I prefer Network Manager, particularly for an 'average' user - it is simpler and the applet icon illustrates the signal strength. Can anyone point me in the right direction for writing a script that runs when the XFCE session is closing ? - as a get-around.* I would prefer if I can just use python since this is just temporary.* Can anyone tell me the (XFCE?) library that should look at ? - and maybe suggest objects/methods, etc. -- xubuntu-devel mailing list xubuntu-devel@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/xubuntu-devel |
Slow Shutdown when Network Mgr closes before CIFS unmounted
FYI, I worked out a fix for this problem in Xubuntu.
This works for me with both a shutdown and restart using the GUI. # Rename the executable that is called when shutting down or rebooting. cd /usr/sbin sudo mv xfsm-shutdown-helper xfsm-shutdown-helper-orig # Replace the executable with a script. gksu mousepad xfsm-shutdown-helper Create these lines in the new file .. * !#/bin/sh ** # XFCE shutting down - close network connections. ** /etc/init.d/umountnfs.sh ** # THEN call the original executable. ** /usr/sbin/xfsm-shutdown-helper-orig # Make the new script executable. sudo chmod +x xfsm-shutdown-helper # Check the permissions. /usr/sbin# ls -al xf* -rwxr-xr-x 1 root root* 152 2010-01-21 21:03 xfsm-shutdown-helper -rwxr-xr-x 1 root root 5588 2009-09-19 20:30 xfsm-shutdown-helper-orig -- xubuntu-devel mailing list xubuntu-devel@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/xubuntu-devel |
Slow Shutdown when Network Mgr closes before CIFS unmounted
Correction - the get-around is much easier than the previous e-mail - just make links in the rc folders to umountnfs.sh that are earlier in the alphabet than the existing link to umountnfs.sh.
# For shutdowns .. cd /etc/rc0.d sudo ln -s ../init.d/umountnfs.sh K02umountnfs # For reboots .. cd /etc/rc6.d sudo ln -s ../init.d/umountnfs.sh K02umountnfs (This doesn't work if you use '-n' with the smbmount command - which is why this didn't work for me when I tried it earlier.) -- xubuntu-devel mailing list xubuntu-devel@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/xubuntu-devel |
| All times are GMT. The time now is 04:24 PM. |
VBulletin, Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.