Slow Shutdown when Network Mgr closes before CIFS unmounted
david.8.collins at gmail.com
Fri Jan 15 23:44:04 UTC 2010
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
Would anyone be able to supply the few lines of code required in main()
I could then test and, if successful, post the solution back into the Ubuntu
forums article below.
#Author: Seamus Phelan
#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)
class Namespace: pass
ns = Namespace()
ns.dialog = None
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
def session_save_yourself( *args):
#Unmount those CIFS shares!
retcode = subprocess.call("sudo /etc/init.d/umountnfs.sh", shell=True)
if retcode != 0:
def shutdown_cancelled( *args):
if ns.dialog != None:
ns.dialog = gtk.Dialog("There was a problem running your pre-shutdown
("There was a problem running your pre-shutdown
script - continue logout", gtk.RESPONSE_ACCEPT))
if ns.test_mode == True:
response = ns.dialog.run()
#when in shutdown mode gnome will only allow you to open a window
#It also adds the 'Cancel logout' button
#Find out if we are in test mode???
if len(sys.argv) >=2 and sys.argv == "test":
ns.test_mode = True
ns.test_mode = False
if ns.test_mode == True:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the xubuntu-devel