+++ This bug was initially created as a clone of Bug #1292254 +++ +++ This bug was initially created as a clone of Bug #1290151 +++ There are several reasons why the behaviour in the hook scripts was bad: 1. A samba installation is clustered or non-clustered. That does not change because of the availability of the CTDB lock-volume. If the lock-volume is not available (and hence CTDB is not available or not healthy), then Samba won't be operational. But turning it into a non-clustered Samba-installation can in the worst case lead to data corruption if clients manage to access the same files (on share volumes). Hence 'clustering = yes/no' in Samba's config should not be touched. In particular, Samba should not be stopped/started by the hook script. If needed, then ctdb will take care of it. 2. Changing the idmap configuration is potentially dangerous as well. In particular the used tdb2 backend is legacy nowadays and should not be used any more in new installs. (I stems from the times when ctdb could not host persistent databases.) Changing the idmap can result in loss of access to files or in giving access to files where it is not intended. 3. The pattern used for detecting need for change is fragile. It may or may not play well possible manual changes to smb.conf. Hence the hook scripts should be changed not to do this. --- Additional comment from Vijay Bellur on 2015-12-09 13:37:26 EST --- REVIEW: http://review.gluster.org/12930 (hook-scripts: don't let ctdb script change samba config) posted (#1) for review on master by Michael Adam (obnox) --- Additional comment from Vijay Bellur on 2015-12-10 01:11:42 EST --- REVIEW: http://review.gluster.org/12930 (hook-scripts: don't let ctdb script change samba config) posted (#2) for review on master by Michael Adam (obnox) --- Additional comment from Vijay Bellur on 2015-12-10 04:31:06 EST --- REVIEW: http://review.gluster.org/12930 (hook-scripts: don't let ctdb script change samba config) posted (#3) for review on master by Michael Adam (obnox) --- Additional comment from Vijay Bellur on 2015-12-16 14:13:45 EST --- COMMIT: http://review.gluster.org/12930 committed in master by Raghavendra Talur (rtalur) ------ commit 27c16d6da82876a689dfba53b8d45c3a3a657954 Author: Michael Adam <obnox> Date: Wed Dec 9 18:57:59 2015 +0100 hook-scripts: don't let ctdb script change samba config There are several reasons why the behaviour in the hook scripts was bad: 1. A samba installation is clustered or non-clustered. That does not change because of the availability of the CTDB lock-volume. If the lock-volume is not available (and hence CTDB is not available or not healthy), then Samba won't be operational. But turning it into a non-clustered Samba-installation can in the worst case lead to data corruption if clients manage to access the same files (on share volumes). Hence 'clustering = yes/no' in Samba's config should not be touched. In particular, Samba should not be stopped/started by the hook script. If needed, then ctdb will take care of it. 2. Changing the idmap configuration is potentially dangerous as well. In particular the used tdb2 backend is legacy nowadays and should not be used any more in new installs. (I stems from the times when ctdb could not host persistent databases.) Changing the idmap can result in loss of access to files or in giving access to files where it is not intended. 3. The pattern used for detecting need for change is fragile. It may or may not play well possible manual changes to smb.conf. This change removes the parts that change the smb.conf file and start or stop Samba from the S29CTDB* hook scripts. Change-Id: I72f7aabafa8f089da4531fca2572a72c22825bcc BUG: 1290151 Signed-off-by: Michael Adam <obnox> Reviewed-on: http://review.gluster.org/12930 Tested-by: Gluster Build System <jenkins.com> Reviewed-by: Raghavendra Talur <rtalur> --- Additional comment from Vijay Bellur on 2015-12-16 15:36:24 EST --- REVIEW: http://review.gluster.org/12986 (hook-scripts: don't let ctdb script change samba config) posted (#1) for review on release-3.7 by Michael Adam (obnox)
Upstream master: http://review.gluster.org/12930 Upstream release-3.7: http://review.gluster.org/12986 Downstream: https://code.engineering.redhat.com/gerrit/#/c/64210/
Please add the fixed in Version.
Verified the BZ on RHEL6 with following build : glusterfs-3.7.5-13.el7rhgs.x86_64 samba-4.2.4-12.el7rhgs.x86_64 Following steps are executed: 1.Create a ctdb lock volume as per admin guide instructions 2.Update the S29CTDBSetup and S29teardown hook scripts to add the ctdb volume name in meta=all. 3.started the ctdb volume 4.Verified the mount point /gluster/lock 5.Verified the entries in smb.conf , there should not be any entry created by ctdb volume start(via hook script): the clustering=yes, idmap-backend entry is not added to smb.conf via hook script. 6. Also verified after adding the clustering=yes in smb.conf and stopping ctdb volume does not remove the entry from smb.conf. 7.Started ctdb services , ctdb starts successfully and starts smb service. 8. Again stopped and started the ctdb volume , the smbd service is not restarted. Marking the BZ verified.
Corrected the build versions : glusterfs-3.7.5-13.el6rhs.x86_64 samba-4.2.4-12.el6rhs.x86_64
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2016-0193.html