[Bug 573246] New: mounted shares via mount.cifs disappear when dhclient renews lease
http://bugzilla.novell.com/show_bug.cgi?id=573246 http://bugzilla.novell.com/show_bug.cgi?id=573246#c0 Summary: mounted shares via mount.cifs disappear when dhclient renews lease Classification: openSUSE Product: openSUSE 11.2 Version: Final Platform: x86-64 OS/Version: openSUSE 11.2 Status: NEW Severity: Normal Priority: P5 - None Component: Samba AssignedTo: samba-maintainers@SuSE.de ReportedBy: rmueller@thinxsolutions.com QAContact: samba-maintainers@SuSE.de Found By: --- Blocker: --- User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; de; rv:1.9.1.6) Gecko/20091201 SUSE/3.5.6-1.1.1 Firefox/3.5.6 An currently unused, cifs-mounted share of a samba server will be released when DHCP-Client renews its lease. If there is a file open, the share remains mounted. mount.cifs version: 1.12-3.4.2-1.1.3.1-2229-SUSE-SL11.2 Samba Version: seems to be independent, currently I have tested a 3.2.5 (Deb. Lenny) and an older 3.0.28 Workaround: Increase lease-time at DHCP-Server to a sufficient value Reproducible: Always Steps to Reproduce: 1.Set lease time at dhcpd to a short value, i.e. 300 2.restart network on client 3.mount a share via mount.cifs 3.wait a time greater than 300sec specified above and verify in /var/log/messages that the lease was renewed. 4: check if the cifs-share is still mounted, for me it's always not. Never had this problem with earlier opensuse-versions in the same environment Actual Results: mounted share has gone ;-) Expected Results: share should not disappear at client when lease is renewed -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=573246
http://bugzilla.novell.com/show_bug.cgi?id=573246#c1
James McDonough
http://bugzilla.novell.com/show_bug.cgi?id=573246
http://bugzilla.novell.com/show_bug.cgi?id=573246#c2
Suresh Jayaraman
http://bugzilla.novell.com/show_bug.cgi?id=573246
http://bugzilla.novell.com/show_bug.cgi?id=573246#c3
Suresh Jayaraman
http://bugzilla.novell.com/show_bug.cgi?id=573246
http://bugzilla.novell.com/show_bug.cgi?id=573246#c
Suresh Jayaraman
http://bugzilla.novell.com/show_bug.cgi?id=573246
http://bugzilla.novell.com/show_bug.cgi?id=573246#c4
--- Comment #4 from Robert Mueller
http://bugzilla.novell.com/show_bug.cgi?id=573246
http://bugzilla.novell.com/show_bug.cgi?id=573246#c5
--- Comment #5 from Suresh Jayaraman
http://bugzilla.novell.com/show_bug.cgi?id=573246
http://bugzilla.novell.com/show_bug.cgi?id=573246#c6
Robert Mueller
http://bugzilla.novell.com/show_bug.cgi?id=573246
http://bugzilla.novell.com/show_bug.cgi?id=573246#c7
Suresh Jayaraman
http://bugzilla.novell.com/show_bug.cgi?id=573246
http://bugzilla.novell.com/show_bug.cgi?id=573246#c8
Robert Mueller
http://bugzilla.novell.com/show_bug.cgi?id=573246
http://bugzilla.novell.com/show_bug.cgi?id=573246#c9
Suresh Jayaraman
http://bugzilla.novell.com/show_bug.cgi?id=573246
http://bugzilla.novell.com/show_bug.cgi?id=573246#c10
Suresh Jayaraman
http://bugzilla.novell.com/show_bug.cgi?id=573246
http://bugzilla.novell.com/show_bug.cgi?id=573246#c11
Christian Eggers
http://bugzilla.novell.com/show_bug.cgi?id=573246
http://bugzilla.novell.com/show_bug.cgi?id=573246#c12
--- Comment #12 from Robert Mueller
http://bugzilla.novell.com/show_bug.cgi?id=573246
http://bugzilla.novell.com/show_bug.cgi?id=573246#c13
Suresh Jayaraman
http://bugzilla.novell.com/show_bug.cgi?id=573246
http://bugzilla.novell.com/show_bug.cgi?id=573246#c14
Christian Eggers
There was a known bug bnc#551376 that fixed a problem of '-p' option being not honoured. This fix is present in dhcpcd-3.2.3 and greater. openSUSE 11.2 is already shipped with dhcpcd-3.2.3-47.2. I'm using the latest version from openSUSE 11.2 updates (dhcpcd-3.2.3-47.4.1).
(In reply to comment #13)
There was a known bug in dhcpcd as mentioned in Comment #9. Please upgrade your dhcpcd version and try to use '-p' option and update whether the issue is still reproducible.
I've entered the -p option to DHCPCD_USER_OPTIONS in /etc/sysconfig/network/dhcp and rebooted the system. I cannot see any difference, the script "/etc/sysconfig/network/scripts/dhcpcd-hook [...] up" is still called every 5 minutes which in turn umounts all cifs shares. I cannot see that there might be anything wrong with dhcpcd (or its configuration). For me it seems to be obvious that either the call to "rcsmbfs restart" (in if-up.d/21-smbfs) should be changed, or rcsmbfs had to be reworked, that a stop/restart only umounts shares originally present in smbfstab. (but the latter would also be a poor solution because then some shares would be periodically remounted every few minutes) regards Christian -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=573246
http://bugzilla.novell.com/show_bug.cgi?id=573246#c15
Suresh Jayaraman
I cannot see that there might be anything wrong with dhcpcd (or its configuration). For me it seems to be obvious that either the call to "rcsmbfs restart" (in if-up.d/21-smbfs) should be changed, or rcsmbfs had to be reworked, that a stop/restart only umounts shares originally present in smbfstab. (but the latter would also be a poor solution because then some shares would be periodically remounted every few minutes)
This bug was not reproducible in my setup with dhclient and that is why I'm thinking this is a dhcpcd issue. Could you see whether it is reproducible when you use dhclient instead of dhcpcd? Also I think this is nothing specific to cifs; any network filesystem should have the same behavior (for e.g. nfs mounts). -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=573246
http://bugzilla.novell.com/show_bug.cgi?id=573246#c16
Christian Eggers
This bug was not reproducible in my setup with dhclient and that is why I'm thinking this is a dhcpcd issue. Could you see whether it is reproducible when you use dhclient instead of dhcpcd?
It's not surprising that the problem doesn't exist with dhclient. With dhcpcd a complex script (/etc/sysconfig/network/scripts/dhcpcd-hook) is called periodically every time the lease is renewed. dhclient uses a completely different script (/sbin/dhclient-script) which is only called once after dhclient initially gets the lease. dhclient (at startup): ---------------------- ifup br0 --> ifup-dhcp br0 --> /sbin/dhclient --> /sbin/dhclient-script dhclient (at lease renewal): ---------------------- /sbin/dhclient <nothing> dhcpcd (at startup): -------------------- ifup br0 --> ifup-dhcp br0 --> /sbin/dhcpcd --> /etc/sysconfig/network/scripts/dhcpcd-hook --> ifdown br0 -o dhcp --> ifup br0 -o dhcp --> if-up.d/21-smbfs --> rcsmbfs restart dhcpcd (at lease renewal): -------------------------- /sbin/dhcpcd --> /etc/sysconfig/network/scripts/dhcpcd-hook --> ifup br0 -o dhcp --> if-up.d/21-smbfs --> rcsmbfs restart
Also I think this is nothing specific to cifs; any network filesystem should have the same behavior (for e.g. nfs mounts).
I don't know why the package "samba-client" places a script into /etc/sysconfig/network/if-up.d/ and the package "nfs-client" doesn't. Using dhclient instead of dhcpcd is no solution for me. Why not fixing the configuration for dhcpcd? regards Christian -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=573246
http://bugzilla.novell.com/show_bug.cgi?id=573246#c17
Suresh Jayaraman
http://bugzilla.novell.com/show_bug.cgi?id=573246
http://bugzilla.novell.com/show_bug.cgi?id=573246#c18
Gustav Haapalahti
http://bugzilla.novell.com/show_bug.cgi?id=573246
http://bugzilla.novell.com/show_bug.cgi?id=573246#c
yang xiaoyu
http://bugzilla.novell.com/show_bug.cgi?id=573246
http://bugzilla.novell.com/show_bug.cgi?id=573246#c19
Suresh Jayaraman
http://bugzilla.novell.com/show_bug.cgi?id=573246
http://bugzilla.novell.com/show_bug.cgi?id=573246#c20
--- Comment #20 from Gustav Haapalahti
http://bugzilla.novell.com/show_bug.cgi?id=573246
http://bugzilla.novell.com/show_bug.cgi?id=573246#c21
Marius Tomaschewski
(In reply to comment #15)
This bug was not reproducible in my setup with dhclient and that is why I'm thinking this is a dhcpcd issue. Could you see whether it is reproducible when you use dhclient instead of dhcpcd?
It's not surprising that the problem doesn't exist with dhclient. With dhcpcd a complex script (/etc/sysconfig/network/scripts/dhcpcd-hook) is called periodically every time the lease is renewed. dhclient uses a completely different script (/sbin/dhclient-script) which is only called once after dhclient initially gets the lease.
dhclient (at startup): ---------------------- ifup br0 --> ifup-dhcp br0 --> /sbin/dhclient --> /sbin/dhclient-script
dhclient (at lease renewal): ---------------------- /sbin/dhclient <nothing>
dhcpcd (at startup): -------------------- ifup br0 --> ifup-dhcp br0 --> /sbin/dhcpcd --> /etc/sysconfig/network/scripts/dhcpcd-hook --> ifdown br0 -o dhcp --> ifup br0 -o dhcp --> if-up.d/21-smbfs --> rcsmbfs restart
dhcpcd (at lease renewal): -------------------------- /sbin/dhcpcd --> /etc/sysconfig/network/scripts/dhcpcd-hook --> ifup br0 -o dhcp --> if-up.d/21-smbfs --> rcsmbfs restart
I'd say it is a broken 21-smbfs script, that ignores the -o dhcp options and restarts the smb/nmb on every "up" ("up ; up ; up" without a "down" between) without any reason / check. Note also: "new" arg to dhcpcd-hook != "dhcp renew": - "new" argument in dhcpcd-hook (dhcpcd --script interface) does not mean "renew" as the name may suggest. it means: new IP address => restart everything; the dhcpcd-hook calls "ifdown $iface -o dhcp ; ifup $iface -o dhcp" then. - "up" argument in dhcpcd-hook means, IP didn't changed changed since last reboot (==dhcp reboot state) and the interface configuration finished. that is, "up" basically means "renew". => just signal post-scripts that we are "up" now via "ifup -o dhcp". We've added an additional "complete" action to dhcpcd/dhcpcd-hook that is called after "up" and "new" and signals, that at this point really all configuration steps are complete, e.g. also the hostname is up-to-date. The "ifup $iface -o dhcp" is called in complete now. The difference is dhcpcd<->dhcpcd-hook internal: - before: up: ... ifup $iface -o dhcp new: ... ifdown $iface -o dhcp ; ifup $iface -o dhcp - current: up: ... new: ... ifdown $iface -o dhcp complete: ifup $iface -o dhcp Note also, that dhclient[-script] was not 100% integrated here and didn't executed any ifup / ifdown -o dhcp actions (that is if-up.d or ifservice scripts) until now. This has been completed/fixed in factory. BTW: See also "man 5 ifservices". -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=573246
http://bugzilla.novell.com/show_bug.cgi?id=573246#c22
Marius Tomaschewski
OK, I have 5 boxes connected to 2 different servers (3 in my office, 2 at home) showing immediately this issue after a fresh install of SuSE 11.2. All machines have had SuSE 11.1 / 10.3 before, without this problem. One server is an old SuSE 9.3 box, an therefore also an very old dhcpd, the other one is a Debian 5 with dhcp3-server package used.
OK, thins means it changed between 11.1 and 11.2, right?
So I don't think it's an issue of dhcpd.
Yesterday I noticed, that SuSE 11.2 installs both dhcpcd and dhclient package, and preferably uses dhcpcd, when nothing is configured in /etc/sysconfig/network/dhcp for the client binary. Now I changed this config to "dhclient", and the issue has gone. All mounts now survive an IP renewal.
So it seems to be an dhcpcd related problem......
No. It is missed integration of the dhclient[-script] :-) But IMO the reason for the problem is the restart in 21-smbfs without any reason / check, except that /etc/init.d/smb and nmb scripts are active. This causes that when the system boots up, there is /etc/init.d/smb start and on _every_ "up" of an interface, 21-smbfs makes /etc/init.d/smb restart -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=573246
http://bugzilla.novell.com/show_bug.cgi?id=573246#c
James McDonough
http://bugzilla.novell.com/show_bug.cgi?id=573246
http://bugzilla.novell.com/show_bug.cgi?id=573246#c23
--- Comment #23 from Christian Eggers
OK, thins means it changed between 11.1 and 11.2, right?
Ack -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=573246
http://bugzilla.novell.com/show_bug.cgi?id=573246#c24
--- Comment #24 from Christian Eggers
http://bugzilla.novell.com/show_bug.cgi?id=573246
http://bugzilla.novell.com/show_bug.cgi?id=573246#c25
Suresh Jayaraman
(In reply to comment #8)
OK, I have 5 boxes connected to 2 different servers (3 in my office, 2 at home) showing immediately this issue after a fresh install of SuSE 11.2. All machines have had SuSE 11.1 / 10.3 before, without this problem. One server is an old SuSE 9.3 box, an therefore also an very old dhcpd, the other one is a Debian 5 with dhcp3-server package used.
OK, thins means it changed between 11.1 and 11.2, right?
So I don't think it's an issue of dhcpd.
Yesterday I noticed, that SuSE 11.2 installs both dhcpcd and dhclient package, and preferably uses dhcpcd, when nothing is configured in /etc/sysconfig/network/dhcp for the client binary. Now I changed this config to "dhclient", and the issue has gone. All mounts now survive an IP renewal.
So it seems to be an dhcpcd related problem......
No. It is missed integration of the dhclient[-script] :-)
But IMO the reason for the problem is the restart in 21-smbfs without any reason / check, except that /etc/init.d/smb and nmb scripts are active.
This causes that when the system boots up, there is /etc/init.d/smb start and on _every_ "up" of an interface, 21-smbfs makes /etc/init.d/smb restart
Lars: Do you remember any change between 11.1 and 11.2 which would have caused the above? I don't remember making any changes to the smb startup script. -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=573246
http://bugzilla.novell.com/show_bug.cgi?id=573246#c26
Lars Müller
http://bugzilla.novell.com/show_bug.cgi?id=573246
http://bugzilla.novell.com/show_bug.cgi?id=573246#c27
Suresh Jayaraman
(In reply to comment #8)
OK, thins means it changed between 11.1 and 11.2, right?
So I don't think it's an issue of dhcpd.
Yesterday I noticed, that SuSE 11.2 installs both dhcpcd and dhclient package, and preferably uses dhcpcd, when nothing is configured in /etc/sysconfig/network/dhcp for the client binary. Now I changed this config to "dhclient", and the issue has gone. All mounts now survive an IP renewal.
So it seems to be an dhcpcd related problem......
No. It is missed integration of the dhclient[-script] :-)
But IMO the reason for the problem is the restart in 21-smbfs without any reason / check, except that /etc/init.d/smb and nmb scripts are active.
This causes that when the system boots up, there is /etc/init.d/smb start and on _every_ "up" of an interface, 21-smbfs makes /etc/init.d/smb restart
There is no change between 11.1 and 11.2 in smb init script. If this is the issue, how come it didn't appear in 11.1 and earlier? Has something changed in Network manager or dhcpcd..? If it is due to some other changes, then it is a regression caused by that component and not smb/cifs, right? -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=573246
http://bugzilla.novell.com/show_bug.cgi?id=573246#c28
Marius Tomaschewski
(In reply to comment #22)
(In reply to comment #8)
So it seems to be an dhcpcd related problem......
No. It is missed integration of the dhclient[-script] :-)
But IMO the reason for the problem is the restart in 21-smbfs without any reason / check, except that /etc/init.d/smb and nmb scripts are active.
This causes that when the system boots up, there is /etc/init.d/smb start and on _every_ "up" of an interface, 21-smbfs makes /etc/init.d/smb restart
There is no change between 11.1 and 11.2 in smb init script. If this is the issue, how come it didn't appear in 11.1 and earlier? Has something changed in Network manager or dhcpcd..?
If it is due to some other changes, then it is a regression caused by that component and not smb/cifs, right?
No, it isn't a regression in sysconfig. It is an incorrect 21-smbfs script. I _guess_ the umounts just failed before and didn't caused any problem. The dhcpcd hook on SLE-10 and I think already on SLES-9 also called the if-up.d scripts -- the ifup man page documents this. SuSEfirewall2 using the if-up.d interface would not refresh its rules without these calls. -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=573246
http://bugzilla.novell.com/show_bug.cgi?id=573246#c29
--- Comment #29 from Suresh Jayaraman
http://bugzilla.novell.com/show_bug.cgi?id=573246
http://bugzilla.novell.com/show_bug.cgi?id=573246#c30
--- Comment #30 from Suresh Jayaraman
http://bugzilla.novell.com/show_bug.cgi?id=573246
http://bugzilla.novell.com/show_bug.cgi?id=573246#c31
--- Comment #31 from Marius Tomaschewski
I think the reason behind 21-smbfs or 21-cifs (in 11.3) restarting rccifs when the lease is renewed because the IPaddress could possibly change.
Yes, I think also this was the reason for.
However, it should not never drop the existing mounts.
Well, when the old IP went away (or more worse: e.g. the network changed) it is required to remount I think... (In reply to comment #30)
Looks like if we are able to get the 'state' value from /etc/sysconfig/network/scripts/dhcpcd-hook, then we could check if 'state' is 'new' and not 'up' and restart the rccifs script.
Marius, Lars, any idea whether it is possible to pass this 'state' value down to 21-cifs script?
You can read it with: /etc/sysconfig/network/scripts/functions state=`read_cached_config_data dhcp4_state "$interface"` or also like this: state=`{ . /etc/sysconfig/network/scripts/functions && \ read_cached_config_data dhcp4_state "$interface" ; } 2>/dev/null` -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=573246
http://bugzilla.novell.com/show_bug.cgi?id=573246#c32
--- Comment #32 from Suresh Jayaraman
http://bugzilla.novell.com/show_bug.cgi?id=573246
http://bugzilla.novell.com/show_bug.cgi?id=573246#c
Suresh Jayaraman
http://bugzilla.novell.com/show_bug.cgi?id=573246
http://bugzilla.novell.com/show_bug.cgi?id=573246#c34
Christian Eggers
Created an attachment (id=374259) --> (http://bugzilla.novell.com/attachment.cgi?id=374259) [details] Proposed patch
Could you patch /etc/sysconfig/network/if-up.d/21-cifs (preferably backup original file) with the changes attached and see whether it resolves the problem for you?
On 11.2, the file name is /etc/sysconfig/network/if-up.d/21-smbfs. Instead of patching the symlink I've created a patch for the target file (/etc/sysconfig/network/scripts/smbfs). Please note my change in the "if" condition, your syntax might be wrong: your if "$state" == "new" mine if [ "$state" = "new" ] Altogether the patch seems to work, my cifs mounts are not disconnected anymore. Additionally you might think about only unmounting shared listed in smbfstab instead of using "umount -at cifs" -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=573246
http://bugzilla.novell.com/show_bug.cgi?id=573246#c35
--- Comment #35 from Suresh Jayaraman
http://bugzilla.novell.com/show_bug.cgi?id=573246
http://bugzilla.novell.com/show_bug.cgi?id=573246#c
Suresh Jayaraman
http://bugzilla.novell.com/show_bug.cgi?id=573246
http://bugzilla.novell.com/show_bug.cgi?id=573246#c36
Lars Müller
http://bugzilla.novell.com/show_bug.cgi?id=573246
http://bugzilla.novell.com/show_bug.cgi?id=573246#c37
Suresh Jayaraman
https://bugzilla.novell.com/show_bug.cgi?id=573246
https://bugzilla.novell.com/show_bug.cgi?id=573246#c38
Swamp Workflow Management
https://bugzilla.novell.com/show_bug.cgi?id=573246
https://bugzilla.novell.com/show_bug.cgi?id=573246#c39
Swamp Workflow Management
https://bugzilla.novell.com/show_bug.cgi?id=573246
https://bugzilla.novell.com/show_bug.cgi?id=573246#c40
Swamp Workflow Management
https://bugzilla.novell.com/show_bug.cgi?id=573246
https://bugzilla.novell.com/show_bug.cgi?id=573246#c42
Swamp Workflow Management
https://bugzilla.novell.com/show_bug.cgi?id=573246
https://bugzilla.novell.com/show_bug.cgi?id=573246#c43
Swamp Workflow Management
https://bugzilla.novell.com/show_bug.cgi?id=573246
https://bugzilla.novell.com/show_bug.cgi?id=573246#c
Swamp Workflow Management
http://bugzilla.novell.com/show_bug.cgi?id=573246
http://bugzilla.novell.com/show_bug.cgi?id=573246#c44
--- Comment #44 from Bernhard Wiedemann
participants (1)
-
bugzilla_noreply@novell.com