Description of problem: When using CTDB with Samba, if the ctdb and nmb services are both enabled, restarting ctdb.service will cause nmb.service to fail and not recovery. There should be an 'After' and 'Requires' dependency in the nmb.service systemd file for ctdb.service. Version-Release number of selected component (if applicable): 219-42.el7_4.4 How reproducible: Consistently Steps to Reproduce: 1. Configure and enable both the CTDB and NMB services 2. Start both services 3. Restart the CTDB service Actual results: The NMB service is in a failed state requiring manual intervention Expected results: The NMB service recovers correctly based on systemd dependency Additional info:
Dependencies should be fixed in the respective service. Reassigning to samba.
Note that my solution of setting the nmb.service to require ctdb.service only works if ctdb is in use, and would break things if it was not. I'm not sure of the actual best solution for this problem.
What exactly stops working. nmbd doesn't talk to ctdb at all.
(In reply to Andreas Schneider from comment #4) > What exactly stops working. nmbd doesn't talk to ctdb at all. The problem may actually be because CTDB is set to control the Samba service. So when CTDB restarts, so does Samba. Would restarting Samba outside of systemd cause the nmbd service to fail?
(In reply to Dustin Black from comment #6) > (In reply to Andreas Schneider from comment #4) > > What exactly stops working. nmbd doesn't talk to ctdb at all. > > The problem may actually be because CTDB is set to control the Samba > service. Why do you think it is a problem? > So when CTDB restarts, so does Samba. This dependency is configured via the parameter CTDB_MANAGES_SAMBA. When set to 'yes' CTDB will try to bring up and monitor smbd. > Would restarting Samba outside of systemd cause the nmbd service to fail? Do you have journal entries, nmbd, smbd and ctdb logs which indicate the error? (In reply to Dustin Black from comment #0) > Steps to Reproduce: > 1. Configure and enable both the CTDB and NMB services > 2. Start both services > 3. Restart the CTDB service I have ctdbd, smbd and nmbd running in my environment with following parameters set in /etc/sysconfig/ctdb after performing the above steps: # cat /etc/sysconfig/ctdb CTDB_RECOVERY_LOCK=/gluster/lock/lockfile CTDB_PUBLIC_ADDRESSES=/etc/ctdb/public_addresses CTDB_MANAGES_SAMBA=yes CTDB_SAMBA_SKIP_SHARE_CHECK=yes
Pasting the suggestion from Martin: """ The script is currently/still based on RHEL versions <= 6. In those versions /etc/init.d/smb appears to be the only Samba initscript and it starts nmbd if necessary (i.e. if disable netbios != Yes). In RHEL 7 (I have 7.2 handy right now) it appears that this has changed, with both: /usr/lib/systemd/system/nmb.service /usr/lib/systemd/system/smb.service . . . I think the real fix is to separate out nmbd support into its own event script. Would 48.netbios (or similar) provide the right start order between nmbd, winbindd (via 49.winbind) and smbd (via 50.samba)? The new script could be enabled for those that need it on RHEL >= 7 and on other platforms. RHEL <= 6 could just depend on the existing script implicitly starting nmbd when required. """
(In reply to Anoop C S from comment #17) > Pasting the suggestion from Martin: > > """ > The script is currently/still based on RHEL versions <= 6. In those > versions /etc/init.d/smb appears to be the only Samba initscript and it > starts nmbd if necessary (i.e. if disable netbios != Yes). > > In RHEL 7 (I have 7.2 handy right now) it appears that this has > changed, with both: > > /usr/lib/systemd/system/nmb.service > /usr/lib/systemd/system/smb.service > > . . . > > I think the real fix is to separate out nmbd support into its own event > script. Would 48.netbios (or similar) provide the right start order > between nmbd, winbindd (via 49.winbind) and smbd (via 50.samba)? The > new script could be enabled for those that need it on RHEL >= 7 and on > other platforms. RHEL <= 6 could just depend on the existing script > implicitly starting nmbd when required. > """ Meanwhile above separation for managing nmbd has been implemented upstream.
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 (samba bug fix update), 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://access.redhat.com/errata/RHBA-2020:4403