miércoles, 13 de febrero de 2013

Network Manager and NFS problem on Shutdown

I power up my personal computer with debian system installed. I login and automatically my network manager connect to predefined wireless network because the application nm-applet (network manager applet) or similar has send the order to network manager daemon using dbus communication. I mount one folder using NFS o CIFS.
When i shutdown my computer the error message () appear at the end of shutdown process.
This situation is because the network manager daemon is release before unmount network file systems. The idea is correct because the network manager daemon establish a connection when the nm-applet send the order and the nm-applet only run when user as logging.  But the nfs is a basic part of system like networking. The problem is that networkmanager is used to respond user request (at user level) and change basic system configuration like network parameters. The nfs depend of network interfaces and is release before the network is down but it refer to basic networking daemon, not to networkmanager.
The network manager daemon can modify network connection but must take in consideration that it can release the current connection on shutdown because is the networking daemon who must to do it.
networking - work at system level
network file system - work at system an user level.
networkmanager - work at user level but modifying networking ( problem because start late in time and change system configuration that must be defined at system boot)

The solution is change the release order of daemon on system level 6 and 0. 

ls /etc/rc6.d/
...
K02network-manager -> ../init.d/network-manager
K03sendsigs -> ../init.d/sendsigs
K04rsyslog -> ../init.d/rsyslog
K05umountnfs.sh -> ../init.d/umountnfs.sh
K06nfs-common -> ../init.d/nfs-common
K06rpcbind -> ../init.d/rpcbind
K07hwclock.sh -> ../init.d/hwclock.sh
K07networking -> ../init.d/networking
K08umountfs -> ../init.d/umountfs
K09umountroot -> ../init.d/umountroot
K10reboot -> ../init.d/reboot

ls /etc/rc0.d/

K02network-manager -> ../init.d/network-manager
K03sendsigs -> ../init.d/sendsigs
K04rsyslog -> ../init.d/rsyslog
K05umountnfs.sh -> ../init.d/umountnfs.sh
K06nfs-common -> ../init.d/nfs-common
K06rpcbind -> ../init.d/rpcbind
K07hwclock.sh -> ../init.d/hwclock.sh
K07networking -> ../init.d/networking
K08umountfs -> ../init.d/umountfs
K09umountroot -> ../init.d/umountroot
K10halt -> ../init.d/halt

Move network-manager from position 2 to position 7 at the same level that networking because it do the same that networking at release (deconfigure network interfaces).