[PATCH] Fix samba daemon startup with systemd

classic Classic list List threaded Threaded
21 messages Options
12
Reply | Threaded
Open this post in threaded view
|

[PATCH] Fix samba daemon startup with systemd

Samba - samba-technical mailing list
Hi,

we need network interfaces to be up before starting samba service.


Please review and push if OK.


Thanks,


        Andreas

--
Andreas Schneider                   GPG-ID: CC014E3D
Samba Team                             [hidden email]
www.samba.org

systemd_samba.patch1.txt (962 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Fix samba daemon startup with systemd

Samba - samba-technical mailing list
On Tue, 12 Dec 2017 08:39:59 +0100
Andreas Schneider via samba-technical <[hidden email]>
wrote:

> Hi,
>
> we need network interfaces to be up before starting samba service.
>
>
> Please review and push if OK.
>
>
> Thanks,
>
>
> Andreas
>

Can somebody explain why Samba is providing systemd service scripts ?
Samba never supplied sysv init scripts.

Rowland

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Fix samba daemon startup with systemd

Samba - samba-technical mailing list
On Tuesday, 12 December 2017 09:50:06 CET Rowland Penny wrote:
> Can somebody explain why Samba is providing systemd service scripts ?
> Samba never supplied sysv init scripts.

Why shouldn't we have a central place to have correct systemd files. There are
several distributions out there using systemd.


        Andreas

--
Andreas Schneider                   GPG-ID: CC014E3D
Samba Team                             [hidden email]
www.samba.org

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Fix samba daemon startup with systemd

Samba - samba-technical mailing list
On Tue, 12 Dec 2017 09:53:05 +0100
Andreas Schneider <[hidden email]> wrote:

> On Tuesday, 12 December 2017 09:50:06 CET Rowland Penny wrote:
> > Can somebody explain why Samba is providing systemd service
> > scripts ? Samba never supplied sysv init scripts.
>
> Why shouldn't we have a central place to have correct systemd files.
> There are several distributions out there using systemd.
>
>
> Andreas
>

OK, why should we have a central place for correct systemd files, we
never did this for sysv, this is for the systemd distributions to do.

Are you going to suggest that Samba should also have Apparmor and
Selinux profiles ? Recommended sssd and nslcd conf files ?

Rowland

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Fix samba daemon startup with systemd

Samba - samba-technical mailing list
On Tue, 2017-12-12 at 09:02 +0000, Rowland Penny via samba-technical
wrote:

> On Tue, 12 Dec 2017 09:53:05 +0100
> Andreas Schneider <[hidden email]> wrote:
>
> > On Tuesday, 12 December 2017 09:50:06 CET Rowland Penny wrote:
> > > Can somebody explain why Samba is providing systemd service
> > > scripts ? Samba never supplied sysv init scripts.
> >
> > Why shouldn't we have a central place to have correct systemd files.
> > There are several distributions out there using systemd.
> >
> >
> > Andreas
> >
>
> OK, why should we have a central place for correct systemd files, we
> never did this for sysv, this is for the systemd distributions to do.
>
> Are you going to suggest that Samba should also have Apparmor and
> Selinux profiles ? Recommended sssd and nslcd conf files ?

Rowland,

Because systemd is the one true init system, naturally we should be
honoured to include a script for it.

Andrew Bartlett
--
Andrew Bartlett                       http://samba.org/~abartlet/
Authentication Developer, Samba Team  http://samba.org
Samba Developer, Catalyst IT          http://catalyst.net.nz/services/samba


Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Fix samba daemon startup with systemd

Samba - samba-technical mailing list
On Tue, 12 Dec 2017 22:13:22 +1300
Andrew Bartlett <[hidden email]> wrote:

> On Tue, 2017-12-12 at 09:02 +0000, Rowland Penny via samba-technical
> wrote:
> > On Tue, 12 Dec 2017 09:53:05 +0100
> > Andreas Schneider <[hidden email]> wrote:
> >
> > > On Tuesday, 12 December 2017 09:50:06 CET Rowland Penny wrote:
> > > > Can somebody explain why Samba is providing systemd service
> > > > scripts ? Samba never supplied sysv init scripts.
> > >
> > > Why shouldn't we have a central place to have correct systemd
> > > files. There are several distributions out there using systemd.
> > >
> > >
> > > Andreas
> > >
> >
> > OK, why should we have a central place for correct systemd files, we
> > never did this for sysv, this is for the systemd distributions to
> > do.
> >
> > Are you going to suggest that Samba should also have Apparmor and
> > Selinux profiles ? Recommended sssd and nslcd conf files ?
>
> Rowland,
>
> Because systemd is the one true init system, naturally we should be
> honoured to include a script for it.
>
> Andrew Bartlett

You might be honoured, I am horrified, just what makes systemd
different to sysv for Samba (apart from systemd being a rats nest of
bugs, sorry features). I would have thought Samba should concentrate
on Samba code and leave how it is started to the distros.

I also thought that the main Samba user base was on servers, you might
want to read this:

https://blog.ungleich.ch/en-us/cms/blog/2017/12/10/the-importance-of-devuan/

Rowland

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Fix samba daemon startup with systemd

Samba - samba-technical mailing list
On Tuesday, 12 December 2017 10:27:17 CET Rowland Penny wrote:

> On Tue, 12 Dec 2017 22:13:22 +1300
>
> Andrew Bartlett <[hidden email]> wrote:
> > On Tue, 2017-12-12 at 09:02 +0000, Rowland Penny via samba-technical
> >
> > wrote:
> > > On Tue, 12 Dec 2017 09:53:05 +0100
> > >
> > > Andreas Schneider <[hidden email]> wrote:
> > > > On Tuesday, 12 December 2017 09:50:06 CET Rowland Penny wrote:
> > > > > Can somebody explain why Samba is providing systemd service
> > > > > scripts ? Samba never supplied sysv init scripts.
> > > >
> > > > Why shouldn't we have a central place to have correct systemd
> > > > files. There are several distributions out there using systemd.
> > > >
> > > > Andreas
> > >
> > > OK, why should we have a central place for correct systemd files, we
> > > never did this for sysv, this is for the systemd distributions to
> > > do.
> > >
> > > Are you going to suggest that Samba should also have Apparmor and
> > > Selinux profiles ? Recommended sssd and nslcd conf files ?
> >
> > Rowland,
> >
> > Because systemd is the one true init system, naturally we should be
> > honoured to include a script for it.
> >
> > Andrew Bartlett
>
> You might be honoured, I am horrified, just what makes systemd
> different to sysv for Samba (apart from systemd being a rats nest of
> bugs, sorry features). I would have thought Samba should concentrate
> on Samba code and leave how it is started to the distros.
>
> I also thought that the main Samba user base was on servers, you might
> want to read this:
>
> https://blog.ungleich.ch/en-us/cms/blog/2017/12/10/the-importance-of-devuan/

So you suggest to remove the whole packaging directory?


        Andreas

--
Andreas Schneider                   GPG-ID: CC014E3D
Samba Team                             [hidden email]
www.samba.org

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Fix samba daemon startup with systemd

Samba - samba-technical mailing list
In reply to this post by Samba - samba-technical mailing list
On Tue, 2017-12-12 at 08:39 +0100, Andreas Schneider via samba-
technical wrote:
> Hi,
>
> we need network interfaces to be up before starting samba service.
>
>
> Please review and push if OK.

G'Day,

Systemd trolling aside, this looks reasonable, but I've not had reason
to understand systemd enough to review it.  What I will note is that
debian is carrying this (attached) patch for nmbd.

Also there is this patch in our github repo:
https://github.com/samba-team/samba/pull/70

It is really good that systemd means enough things are in common enough
to allow upstream to distribute the .service files, as it means these
bugs don't need to be replicated in every distribution.

Could you have a look at all these and work out what needs to be done
in common?

Thanks,

Andrew Barltett

--
Andrew Bartlett                       http://samba.org/~abartlet/
Authentication Developer, Samba Team  http://samba.org
Samba Developer, Catalyst IT          http://catalyst.net.nz/services/samba

nmbd-requires-a-working-network.patch (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Fix samba daemon startup with systemd

Samba - samba-technical mailing list
On Tuesday, 12 December 2017 11:28:25 CET Andrew Bartlett via samba-technical
wrote:

> On Tue, 2017-12-12 at 08:39 +0100, Andreas Schneider via samba-
>
> technical wrote:
> > Hi,
> >
> > we need network interfaces to be up before starting samba service.
> >
> >
> > Please review and push if OK.
>
> G'Day,
>
> Systemd trolling aside, this looks reasonable, but I've not had reason
> to understand systemd enough to review it.  What I will note is that
> debian is carrying this (attached) patch for nmbd.
Yes, we need to wait in nmbd too!
 
> Also there is this patch in our github repo:
> https://github.com/samba-team/samba/pull/70

I think this one is wrong. Waiting for the network interface being up is the
correct thing to do.

Updated patch attached.


The idea is to have a correct location of systemd files. In Fedora we use
those files and modify them using 'sed' during installation.
We could create a python script for installing them which does some kind of /
searc/replace/


        Andreas

--
Andreas Schneider                   GPG-ID: CC014E3D
Samba Team                             [hidden email]
www.samba.org

systemd_samba.patch2.txt (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Fix samba daemon startup with systemd

Samba - samba-technical mailing list
In reply to this post by Samba - samba-technical mailing list
On Tue, Dec 12, 2017 at 2:39 AM, Andreas Schneider via samba-technical
<[hidden email]> wrote:

> Hi,
>
> we need network interfaces to be up before starting samba service.
>
>
> Please review and push if OK.
>
>
> Thanks,
>
>
>         Andreas
>
> --
> Andreas Schneider                   GPG-ID: CC014E3D
> Samba Team                             [hidden email]
> www.samba.org

Sorry, I don't have a systemd based system in hand right now. What
happens incorrectly if the network interfaces are not active when
Samba starts? Does Samba not see new interfaces that get activated
later without a restart?

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Fix samba daemon startup with systemd

Samba - samba-technical mailing list
In reply to this post by Samba - samba-technical mailing list
On Tue, Dec 12, 2017 at 09:27:17AM +0000, Rowland Penny via samba-technical wrote:

> On Tue, 12 Dec 2017 22:13:22 +1300
> Andrew Bartlett <[hidden email]> wrote:
>
> > On Tue, 2017-12-12 at 09:02 +0000, Rowland Penny via samba-technical
> > wrote:
> > > On Tue, 12 Dec 2017 09:53:05 +0100
> > > Andreas Schneider <[hidden email]> wrote:
> > >
> > > > On Tuesday, 12 December 2017 09:50:06 CET Rowland Penny wrote:
> > > > > Can somebody explain why Samba is providing systemd service
> > > > > scripts ? Samba never supplied sysv init scripts.
> > > >
> > > > Why shouldn't we have a central place to have correct systemd
> > > > files. There are several distributions out there using systemd.
> > > >
> > > >
> > > > Andreas
> > > >
> > >
> > > OK, why should we have a central place for correct systemd files, we
> > > never did this for sysv, this is for the systemd distributions to
> > > do.
> > >
> > > Are you going to suggest that Samba should also have Apparmor and
> > > Selinux profiles ? Recommended sssd and nslcd conf files ?
> >
> > Rowland,
> >
> > Because systemd is the one true init system, naturally we should be
> > honoured to include a script for it.
> >
> > Andrew Bartlett
>
> You might be honoured, I am horrified, just what makes systemd

Rowland, you missed the <sarcasm> tag in Andrew's email :-).

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Fix samba daemon startup with systemd

Samba - samba-technical mailing list
In reply to this post by Samba - samba-technical mailing list
On Tue, Dec 12, 2017 at 09:27:17AM +0000, Rowland Penny via samba-technical wrote:

> On Tue, 12 Dec 2017 22:13:22 +1300
> Andrew Bartlett <[hidden email]> wrote:
>
> > On Tue, 2017-12-12 at 09:02 +0000, Rowland Penny via samba-technical
> > wrote:
> > > On Tue, 12 Dec 2017 09:53:05 +0100
> > > Andreas Schneider <[hidden email]> wrote:
> > >
> > > > On Tuesday, 12 December 2017 09:50:06 CET Rowland Penny wrote:
> > > > > Can somebody explain why Samba is providing systemd service
> > > > > scripts ? Samba never supplied sysv init scripts.
> > > >
> > > > Why shouldn't we have a central place to have correct systemd
> > > > files. There are several distributions out there using systemd.
> > > >
> > > >
> > > > Andreas
> > > >
> > >
> > > OK, why should we have a central place for correct systemd files, we
> > > never did this for sysv, this is for the systemd distributions to
> > > do.
> > >
> > > Are you going to suggest that Samba should also have Apparmor and
> > > Selinux profiles ? Recommended sssd and nslcd conf files ?
> >
> > Rowland,
> >
> > Because systemd is the one true init system, naturally we should be
> > honoured to include a script for it.
> >
> > Andrew Bartlett
>
> You might be honoured, I am horrified, just what makes systemd
> different to sysv for Samba (apart from systemd being a rats nest of
> bugs, sorry features). I would have thought Samba should concentrate
> on Samba code and leave how it is started to the distros.
>
> I also thought that the main Samba user base was on servers, you might
> want to read this:

On a more serious note, I haven't reviewed Andreas's patch (yet),
but the Samba repo has customarily hosted auxiliary files for popular
operating systems and distros (as Andrew stated, the packaging/ directory).

If it helps vendors deploy Samba correctly on the system of their choice,
I see no harm in continuing to include such helper files in our repo.

Just my 2cents :-).

Jeremy.

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Fix samba daemon startup with systemd

Samba - samba-technical mailing list
In reply to this post by Samba - samba-technical mailing list
Il giorno mar, 12/12/2017 alle 10.02 -0500, Nico Kadel-Garcia via
samba-technical ha scritto:

> What happens incorrectly if the network interfaces are not active
> when Samba starts?

If the system is restart with "reboot" all work fine when the system
boot because the VM interface (in my case the samba server is a
KVM/Qemu virtual machine) is not destroy and the network starts quickly
and when samba start the interface is already active.

When the VM is "poweroff" and "virsh start addc", the network it takes
a more long time to start and samba start when the interface is not yet
operating. In this case all samba component start except krb5kdc, it
wont start with "KDC: no network interfaces configured" error.

> Does Samba not see new interfaces that get activated later without a
> restart?
If I plug a new network interface, I presume that samba can see it.
But I have not test this scenario.  

--
Dario Lesca
(inviato dal mio Linux Fedora 27 Workstation)

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Fix samba daemon startup with systemd

Samba - samba-technical mailing list
In reply to this post by Samba - samba-technical mailing list
Il giorno mar, 12/12/2017 alle 08.50 +0000, Rowland Penny via samba-
technical ha scritto:
> Can somebody explain why Samba is providing systemd service scripts ?
> Samba never supplied sysv init scripts.

Samba is providing systemd service scripts

    [    lesca@dodo     tmp]$ wget     https://download.samba.org/pub/samba/stable/samba-4.7.3.tar.gz
[lesca@dodo tmp]$ tar xf samba-4.7.3.tar.gz
[lesca@dodo tmp]$ find samba-4.7.3/|grep samba.service
samba-4.7.3/packaging/systemd/samba.service

Or I missing something?

--
Dario Lesca
(inviato dal mio Linux Fedora 27 Workstation)

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Fix samba daemon startup with systemd

Samba - samba-technical mailing list
In reply to this post by Samba - samba-technical mailing list
On Wed, 2017-12-13 at 00:47 +0100, Dario Lesca via samba-technical
wrote:
> Il giorno mar, 12/12/2017 alle 10.02 -0500, Nico Kadel-Garcia via
> samba-technical ha scritto:
>
> >
> > Does Samba not see new interfaces that get activated later without a
> > restart?
>
> If I plug a new network interface, I presume that samba can see it.
> But I have not test this scenario.  

The 'samba' daemon used for the AD DC does not do this at this time.

Andrew Bartlett

--
Andrew Bartlett
https://samba.org/~abartlet/
Authentication Developer, Samba Team         https://samba.org
Samba Development and Support, Catalyst IT  
https://catalyst.net.nz/services/samba





Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Fix samba daemon startup with systemd

Samba - samba-technical mailing list
In reply to this post by Samba - samba-technical mailing list
On Tue, Dec 12, 2017 at 12:32 PM, Jeremy Allison via samba-technical
<[hidden email]> wrote:

> On a more serious note, I haven't reviewed Andreas's patch (yet),
> but the Samba repo has customarily hosted auxiliary files for popular
> operating systems and distros (as Andrew stated, the packaging/ directory).

Reading the patch, it seems reasonable to *me* at first glance. One of
the very few advantages to systemd's incessant feature growth is that
it makes the references to its list of daemons slightly more
consistent so it could be easier to state that init time dependency on
the network configuration more consistent to configure.

But. If it's only needed for Samba with the domain controller features
needed, then shouldn't it be activated only if the domain controller
features are enabled at all? Or is it needed anyway for other,
non-domain controller setups?

> If it helps vendors deploy Samba correctly on the system of their choice,
> I see no harm in continuing to include such helper files in our repo.
>
> Just my 2cents :-).
>
> Jeremy.

I'd agree as somebody who's tried backporting samba-4.x to RHEL and CentOS.

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Fix samba daemon startup with systemd

Samba - samba-technical mailing list
In reply to this post by Samba - samba-technical mailing list
On Tuesday, 12 December 2017 08:39:59 CET Andreas Schneider via samba-
technical wrote:
> Hi,
>
> we need network interfaces to be up before starting samba service.
>
>
> Please review and push if OK.

Ping!

--
Andreas Schneider                   GPG-ID: CC014E3D
Samba Team                             [hidden email]
www.samba.org

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Fix samba daemon startup with systemd

Samba - samba-technical mailing list
In reply to this post by Samba - samba-technical mailing list
On Tuesday, 12 December 2017 12:49:05 CET Andreas Schneider via samba-
technical wrote:

> On Tuesday, 12 December 2017 11:28:25 CET Andrew Bartlett via
> samba-technical
> wrote:
> > On Tue, 2017-12-12 at 08:39 +0100, Andreas Schneider via samba-
> >
> > technical wrote:
> > > Hi,
> > >
> > > we need network interfaces to be up before starting samba service.
> > >
> > >
> > > Please review and push if OK.
> >
> > G'Day,
> >
> > Systemd trolling aside, this looks reasonable, but I've not had reason
> > to understand systemd enough to review it.  What I will note is that
> > debian is carrying this (attached) patch for nmbd.
>
> Yes, we need to wait in nmbd too!
>
> > Also there is this patch in our github repo:
> > https://github.com/samba-team/samba/pull/70
>
> I think this one is wrong. Waiting for the network interface being up is the
> correct thing to do.
>
> Updated patch attached.

Ping!

--
Andreas Schneider                   GPG-ID: CC014E3D
Samba Team                             [hidden email]
www.samba.org

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Fix samba daemon startup with systemd

Samba - samba-technical mailing list
In reply to this post by Samba - samba-technical mailing list
On Tue, Dec 12, 2017 at 12:49:05PM +0100, Andreas Schneider via samba-technical wrote:

> On Tuesday, 12 December 2017 11:28:25 CET Andrew Bartlett via samba-technical
> wrote:
> > On Tue, 2017-12-12 at 08:39 +0100, Andreas Schneider via samba-
> >
> > technical wrote:
> > > Hi,
> > >
> > > we need network interfaces to be up before starting samba service.
> > >
> > >
> > > Please review and push if OK.
> >
> > G'Day,
> >
> > Systemd trolling aside, this looks reasonable, but I've not had reason
> > to understand systemd enough to review it.  What I will note is that
> > debian is carrying this (attached) patch for nmbd.
>
> Yes, we need to wait in nmbd too!
>  
> > Also there is this patch in our github repo:
> > https://github.com/samba-team/samba/pull/70
>
> I think this one is wrong. Waiting for the network interface being up is the
> correct thing to do.
>
> Updated patch attached.

RB+ and pushed. You made me learn about systemd dependencies :-(.
You owe me a beer at SambaXP :-).

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Fix samba daemon startup with systemd

Samba - samba-technical mailing list
On Wednesday, 20 December 2017 00:01:28 CET Jeremy Allison via samba-technical
wrote:
> On Tue, Dec 12, 2017 at 12:49:05PM +0100, Andreas Schneider via samba-
technical wrote:

> > On Tuesday, 12 December 2017 11:28:25 CET Andrew Bartlett via
> > samba-technical>
> > wrote:
> > > On Tue, 2017-12-12 at 08:39 +0100, Andreas Schneider via samba-
> > >
> > > technical wrote:
> > > > Hi,
> > > >
> > > > we need network interfaces to be up before starting samba service.
> > > >
> > > >
> > > > Please review and push if OK.
> > >
> > > G'Day,
> > >
> > > Systemd trolling aside, this looks reasonable, but I've not had reason
> > > to understand systemd enough to review it.  What I will note is that
> > > debian is carrying this (attached) patch for nmbd.
> >
> > Yes, we need to wait in nmbd too!
> >
> > > Also there is this patch in our github repo:
> > > https://github.com/samba-team/samba/pull/70
> >
> > I think this one is wrong. Waiting for the network interface being up is
> > the correct thing to do.
> >
> > Updated patch attached.
>
> RB+ and pushed. You made me learn about systemd dependencies :-(.
> You owe me a beer at SambaXP :-).

Beer at FOSDEM it is! :-)

--
Andreas Schneider                   GPG-ID: CC014E3D
Samba Team                             [hidden email]
www.samba.org



12