I am using 11.1 with standard network set-up (no network manager). In my fstab I have two cifs file systems which are mounted via the wlan0 interface (this is the only active network interface on the machine). wlan0 is set up to be started at system boot.
Unfortunately wlan0 gets sorted into the ‘remotefs’ interface class which is started after the ‘localfs’ interface class and AFTER the cifs mounting. While this is not a big issue at system start (the mounting is retried after the ‘remotefs’ interfaces are set up), it causes big problems at shutdown: the ‘remotefs’ interfaces are shut down and THEN the system tries to unmount the cifs file systems while there is not interface any more causing the system to hang for a long while.
Is there any way to either
sort wlan0 into the ‘localfs’ interface class
or
to unmount the cifs file systems before the remotefs interfaces are shut down?
Any help is greatly appreciated! Thanks,
> Is there any way to either
> - sort wlan0 into the ‘localfs’ interface class
> or
> - to unmount the cifs file systems before the remotefs interfaces are
> shut down?
The usual way to handle this would be to create a script in
/etc/init.d that would unmount the cifs, then create a link
/etc/init.d/rc5.d/K04cifs that points to your script. The Kxxxx
scripts are executed in alphabetical order. I chose 04 because that is
where nfs volumes are unmounted and I know that works.
Thank you! This will definitely work but somehow it is little bit ugly as there is already a script which does the unmounting - only scripts are executed in the wrong sequence. If I put another link to that script or modify the existing link the next update will break most likely things again. Is there no better way to make this ‘the right way’?
juergenmell wrote:
> Thank you! This will definitely work but somehow it is little bit ugly
> as there is already a script which does the unmounting - only scripts
> are executed in the wrong sequence. If I put another link to that script
> or modify the existing link the next update will break most likely
> things again. Is there no better way to make this ‘the right way’?
If you rename the current link so that it executes before the network
shuts down, that would be the right way. You should also file a bug
report with openSUSE so that it becomes standard in the future. As I
said before, nfs does the right thing. I do have some Samba shares in
my network, but they reside on Linux hosts and are only for Windows
clients. For Linux clients, they are nfs mounts.
I found another solution for this problem today: In /etc/sysconfig/network/scripts/functions there is a function ‘supported_on_localfs’. Adding ‘wlan’ to the locally supported network interfaces there solves my problem. Unfortunately this breaks configurations, where files required to set up wlan interfaces are on a device which is mounted eg. by means of NFS.
On the other hand, IMHO it is no good idea to make the setting up of network interfaces depending on the existence of network connections - this is a little bit like a hen and egg problem. The best solution for this might be to put ALL files which are required for setting up ANY network interface on a local drive. Or it should be checked individually for each interface, if all required files are available locally - but this is most likely not feasible.
Besides problems with the wireless interface the same problem can occur with a cabled connection (OpenSUSE 11.2 64bit).
My laptop has serious problems shutting down when CIFS connections are still connected.
To work-a-round first I created some scripts.
Mount CIFS connections from fstab:
#! /bin/bash
sudo mount -a
Un-mount CIFS connections from mtab (made a script /usr/local/bin/cifsu):
To avoid passwords the mount and umount command can be added to the /etc/sudoers file
Then to force disconnection during suspend/hibernate, I changed the file /usr/lib/pm-utils/sleep.d/10NetworkManager:
#!/bin/bash
. /usr/lib/pm-utils/functions
suspend_nm() {
# Tell NetworkManager to shut down networking
dbus-send --system \
--print-reply --reply-timeout=200 \
--dest=org.freedesktop.NetworkManager \
/org/freedesktop/NetworkManager \
org.freedesktop.NetworkManager.sleep
}
resume_nm() {
# Wake up NetworkManager and make it do a new connection
dbus-send --system \
--print-reply --reply-timeout=200 \
--dest=org.freedesktop.NetworkManager \
/org/freedesktop/NetworkManager \
org.freedesktop.NetworkManager.wake
}
case "$1" in
hibernate|suspend)
**/usr/local/bin/cifsu**
suspend_nm
;;
thaw|resume)
resume_nm
;;
*)
;;
esac
exit $?
Finally, to avoid the networkmanager to be shutdown before the CIFS-connections are closed, I changed the script
/etc/init.d/network after line 197:
stop)
if nm_running; then
** mesg_n "Closing CIFS connections. "
/usr/local/bin/cifsu**
mesg_n "Shutting down the NetworkManager"
$FAKE killproc -TERM $NETWORKMANAGER_BIN
rc_status -v
fi
# else fall through to NetControl