Bug 12371 - Error in 50.samba-eventscript
Summary: Error in 50.samba-eventscript
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: CTDB (show other bugs)
Version: 4.5.0
Hardware: All Linux
: P5 normal (vote)
Target Milestone: ---
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
Depends on:
Reported: 2016-10-10 14:49 UTC by Stefan Kania
Modified: 2016-11-17 07:48 UTC (History)
3 users (show)

See Also:

CTDB: Fix samba eventscript (867 bytes, patch)
2016-10-31 14:20 UTC, Mathieu Parent
no flags Details
CTDB: Fix samba eventscript (922 bytes, patch)
2016-11-01 13:07 UTC, Mathieu Parent
no flags Details
Patch for 4.4 and 4.5 (4.24 KB, patch)
2016-11-15 00:58 UTC, Martin Schwenke
amitay: review+

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Kania 2016-10-10 14:49:08 UTC
I tried to start samba on Ubunut-server 16.04 via ctdb. Start failed with error:
2016/10/06 18:31:32.357887 [29921]: 50.samba: Failed to start
samba.service: Unit samba.service is masked.

I figured out, that Ubuntu is not using samba.service to start smbd and nmbd, insted smbd.service and nmbd.service is used. 

So I change /etc/ctdb/events.d/50.samba as followed:

after that Samba will start via CTDB. I think it will be the same on debian-systems, so the script should be changed
Comment 1 Martin Schwenke 2016-10-11 00:11:12 UTC
Andrew, given that you're a Debian maintainer (or similar) for Samba, can you please comment on how CTDB should be starting/stopping smb and nmb services?

Until now we have used the "samba" initscript.  However, it looks to me as though Debian as if the "samba" initscript is probably deprecated from jessie onwards, so we should be using "smbd" and "nmbd" these days.

Comment 2 Martin Schwenke 2016-10-11 00:17:31 UTC
Stefan, you know you can just do this in your CTDB configuration file?


We'll obviously fix the default if a change makes sense, but you don't actually need to edit the event script.  :-)
Comment 3 Mathieu Parent 2016-10-31 13:48:23 UTC
Hello all,

I can confirm that the correct fix is what Stefan said. this bug was introduced in 2:4.4.4+dfsg-2 (i.e jessie should not be affected) while fixing <https://bugs.debian.org/828137>.

I'll fix this in 2:4.4.7+dfsg-1.

Also, we have a bunch of systemd patches in Debian, we need to forward them.
Comment 4 Mathieu Parent 2016-10-31 13:59:38 UTC
(In reply to Mathieu Parent from comment #3)
> Also, we have a bunch of systemd patches in Debian, we need to forward them.

This is https://bugzilla.samba.org/show_bug.cgi?id=12402
Comment 5 Mathieu Parent 2016-10-31 14:20:53 UTC
Created attachment 12617 [details]
CTDB: Fix samba eventscript

And here's the patch that'll go in next upload to sid.
Comment 6 Martin Schwenke 2016-11-01 02:44:49 UTC
(In reply to Mathieu Parent from comment #5)

OK, want to re-attach with a Signed-off-by: tag?

jessie has the new smbd and nmbd services/initscripts, but also has the old samba initscript for backward compatibility.  So, at this stage I think we can safely make the change.
Comment 7 Mathieu Parent 2016-11-01 13:07:14 UTC
Created attachment 12621 [details]
CTDB: Fix samba eventscript

The signed-off patch.
Comment 8 Martin Schwenke 2016-11-01 21:37:52 UTC
Stefan, do you wanted Reported-by:, Signed-off-by; or neither?  :-)

I can add whatever you want when it goes into master...
Comment 9 Martin Schwenke 2016-11-04 00:29:54 UTC
Mathieu and Stefan have agreed to both sign off on the patch.  I'll post it to master now and will add new cherry-picked attachments after it lands.
Comment 10 Martin Schwenke 2016-11-15 00:58:44 UTC
Created attachment 12665 [details]
Patch for 4.4 and 4.5

Same patch applies cleanly to both v4-5-test and v4-4-test.
Comment 11 Amitay Isaacs 2016-11-15 04:22:53 UTC
Hi Karolin,

This is ready for v4-4 and v4-5.  Same patch applies to both.
Comment 12 Karolin Seeger 2016-11-16 07:34:43 UTC
(In reply to Amitay Isaacs from comment #11)
Pushed to autobuild-v4-{5,4}-test.
Comment 13 Karolin Seeger 2016-11-17 07:48:14 UTC
(In reply to Karolin Seeger from comment #12)
Pushed to both branches.
Closing out bug report.