Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 490394 - Add samba.service for systemd to >=net-fs/samba-4.1.0
Summary: Add samba.service for systemd to >=net-fs/samba-4.1.0
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal enhancement
Assignee: Gentoo's SAMBA Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: install-systemd-unit samba-4
  Show dependency tree
 
Reported: 2013-11-04 15:05 UTC by Torsten Kurbad
Modified: 2016-04-04 15:22 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
samba.service (samba.service,287 bytes, text/plain)
2013-11-04 15:05 UTC, Torsten Kurbad
Details
samba-4.1.0-r1.ebuild.diff (samba-4.1.0-r1.ebuild.diff,451 bytes, patch)
2013-11-04 15:06 UTC, Torsten Kurbad
Details | Diff
Samba-4 systemd unit file, non-forking version (samba.service,199 bytes, text/plain)
2013-11-24 21:00 UTC, Daniel Klaffenbach
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Torsten Kurbad 2013-11-04 15:05:02 UTC
After switching to systemd, I noticed that the >=net-fs/samba-4.1.0 ebuilds don't install a samba.service file to start samba 4 as an AD server.

I'll attach a diff to the ebuild and a samba.service unit that atm goes into ${FILESDIR}/4.1. Perhaps it can be placed in ${FILESDIR} to be available to the 4.0 revisions, too, but I'll leave that to the maintainer.

Reproducible: Always
Comment 1 Torsten Kurbad 2013-11-04 15:05:39 UTC
Created attachment 362562 [details]
samba.service
Comment 2 Torsten Kurbad 2013-11-04 15:06:37 UTC
Created attachment 362564 [details, diff]
samba-4.1.0-r1.ebuild.diff
Comment 3 Pacho Ramos gentoo-dev 2013-11-09 14:26:46 UTC
I guess currently installed unit files are not enough for samba-4 ?
Comment 4 Daniel Klaffenbach 2013-11-24 20:54:11 UTC
(In reply to Pacho Ramos from comment #3)
> I guess currently installed unit files are not enough for samba-4 ?
No, they are not enough.

The current samba-4.1 ebuild only installs unit files for nmbd/smbd/winbindd. But in AD DC mode these daemons are not supposed to be started individually. In this case they are started by the "samba" binary (depending on the operation mode).
Comment 5 Daniel Klaffenbach 2013-11-24 21:00:37 UTC
Created attachment 363914 [details]
Samba-4 systemd unit file, non-forking version

According to [1] unit files should not use Type=forking. This unit file now uses Type=simple and logs to systemd's journal.

[1] http://wiki.gentoo.org/wiki/Systemd/Ebuild_policy
Comment 6 Pacho Ramos gentoo-dev 2013-11-27 20:53:30 UTC
+  27 Nov 2013; Pacho Ramos <pacho@gentoo.org> +files/samba.service,
+  samba-4.1.2.ebuild:
+  Add a samba.service unit file (#490394 by Daniel Klaffenbach)
+
Comment 7 Chris Smith 2016-04-04 14:57:56 UTC
(In reply to Daniel Klaffenbach from comment #5)
> Created attachment 363914 [details]
> Samba-4 systemd unit file, non-forking version
> 
> According to [1] unit files should not use Type=forking. This unit file now
> uses Type=simple and logs to systemd's journal.
> 
> [1] http://wiki.gentoo.org/wiki/Systemd/Ebuild_policy

I'm not sure which Type guideline Samba doesn't quite obey with but in general the Samba AD should be run as a daemon and not in interactive mode. And to start it as a daemon with systemd the forking version is required.
Comment 8 Mike Gilbert gentoo-dev 2016-04-04 15:22:59 UTC
(In reply to Chris Smith from comment #7)

The systemd ebuild policy has been changed within the last year to favor forking when appropriate.

Please file a new bug if another adjustment to samba needs to be made.