Bug 41644 - Subtle problems after /etc/init.d/samba restart
Subtle problems after /etc/init.d/samba restart
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Samba4
UCS 4.1
Other Linux
: P2 normal (vote)
: UCS 4.1-2-errata
Assigned To: Arvid Requate
Felix Botner
http://braeda.knut.univention.de/gitw...
:
Depends on:
Blocks: 40662
  Show dependency treegraph
 
Reported: 2016-06-22 22:03 CEST by Arvid Requate
Modified: 2016-09-29 17:31 CEST (History)
3 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 3: Simply Wrong: The implementation doesn't match the docu
Who will be affected by this bug?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.034
Enterprise Customer affected?: Yes
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional): Troubleshooting
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Arvid Requate univentionstaff 2016-06-22 22:03:13 CEST
Under some circumstances Samba/Winbind shows erratic behaviour after running

  service samba restart

e.g. while configuring a domain trust (Bug #40662), where I consistently received an received a ERROR(0xC0020035) corresponding to DCERPC_FAULT_CANT_PERFORM triggered by a NT_STATUS_OBJECT_NAME_NOT_FOUND response from winbind.

The same thing works when I add another "service nmbd restart".

The difference: This causes issues:
====================================================
root@master10:~# service samba restart
[ ok ] Stopping NetBIOS name server: nmbd.
[ ok ] Starting NetBIOS name server: nmbd.
Samba is configured as AD DC, service smbd is controlled by the main samba daemon.
[ ok ] Stopping Samba AD DC daemon: samba.
[ ok ] Starting Samba AD DC daemon: samba.
====================================================

This works:
====================================================
root@master10:~# service samba stop; service samba start
[ ok ] Stopping Samba AD DC daemon: samba.
Samba is configured as AD DC, service smbd is controlled by the main samba daemon.
[ ok ] Stopping NetBIOS name server: nmbd.
[ ok ] Starting NetBIOS name server: nmbd.
Samba is configured as AD DC, service smbd is controlled by the main samba daemon.
[ ok ] Starting Samba AD DC daemon: samba.
====================================================


The script /etc/init.d/samba script is just a wrapper for "nmbd", "smbd" and "samba-ad-dc", so we can do it manually:

This causes issues:
====================================================
root@master10:~# service nmbd restart; service samba-ad-dc restart;
[ ok ] Stopping NetBIOS name server: nmbd.
[ ok ] Starting NetBIOS name server: nmbd.
[ ok ] Stopping Samba AD DC daemon: samba.
[ ok ] Starting Samba AD DC daemon: samba
====================================================

This works:
====================================================
root@master10:~# service nmbd stop; service samba-ad-dc restart; \
                               service nmbd start
[ ok ] Stopping NetBIOS name server: nmbd.
[ ok ] Stopping Samba AD DC daemon: samba.
[ ok ] Starting Samba AD DC daemon: samba.
[ ok ] Starting NetBIOS name server: nmbd.
====================================================

This also works:
====================================================
root@master10:~# service samba-ad-dc restart; service nmbd restart
[ ok ] Stopping Samba AD DC daemon: samba.
[ ok ] Starting Samba AD DC daemon: samba.
[ ok ] Stopping NetBIOS name server: nmbd.
[ ok ] Starting NetBIOS name server: nmbd.
====================================================

So, we should simply adjust the init wrapper script to restart samba-ad-dc first and nmbd later.
Comment 1 Arvid Requate univentionstaff 2016-06-23 15:24:10 CEST
Fixed.

Advisory: samba.yaml

Tested with http://braeda.knut.univention.de/gitweb/?p=.git;a=blob;f=setup_domain_trust.sh;hb=HEAD
Comment 2 Arvid Requate univentionstaff 2016-06-23 15:31:17 CEST
Updated link, see URL field above.
Comment 3 Felix Botner univentionstaff 2016-06-29 10:36:39 CEST
OK - patch looks good
OK - restart works

-> /etc/init.d/samba restart
[ ok ] Stopping Samba AD DC daemon: samba.
Samba is configured as AD DC, service smbd is controlled by the main samba daemon.
[ ok ] Stopping NetBIOS name server: nmbd.
[ ok ] Starting NetBIOS name server: nmbd.
Samba is configured as AD DC, service smbd is controlled by the main samba daemon.
[ ok ] Starting Samba AD DC daemon: samba.

OK - ucs-test
OK - samba.yaml
Comment 4 Janek Walkenhorst univentionstaff 2016-07-11 12:31:10 CEST
<http://errata.software-univention.de/ucs/4.1/210.html>