Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 433074 - net-fs/samba: add systemd unit
Summary: net-fs/samba: add systemd unit
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: Gentoo's SAMBA Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: install-systemd-unit systemd-love
  Show dependency tree
 
Reported: 2012-08-28 16:20 UTC by RedEyedMan
Modified: 2013-07-13 11:21 UTC (History)
3 users (show)

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


Attachments
samba.service (samba.service,277 bytes, application/octet-stream)
2012-10-24 15:01 UTC, RedEyedMan
Details
nmbd.service (nmbd.service,275 bytes, text/plain)
2012-10-24 15:06 UTC, RedEyedMan
Details
samba.service (samba.service,277 bytes, text/plain)
2012-10-24 15:07 UTC, RedEyedMan
Details
samba-3.6.9.ebuild.patch (samba-3.6.9.ebuild.patch,768 bytes, patch)
2013-02-14 11:49 UTC, Alexander Tsoy
Details | Diff
samba.confd.patch (samba.confd.patch,391 bytes, patch)
2013-02-14 11:53 UTC, Alexander Tsoy
Details | Diff
windbd.service (winbind.service,299 bytes, text/plain)
2013-02-15 18:15 UTC, RedEyedMan
Details
smbd.service (smbd.service,316 bytes, text/plain)
2013-02-15 18:18 UTC, RedEyedMan
Details
nmbd.service (nmbd.service,270 bytes, text/plain)
2013-02-15 18:19 UTC, RedEyedMan
Details
samba-3.6.12.ebuild.patch (samba-3.6.12.ebuild.patch,837 bytes, patch)
2013-02-22 13:34 UTC, Alexander Tsoy
Details | Diff
samba.tmpfilesd (samba.tmpfilesd,34 bytes, text/plain)
2013-02-22 21:26 UTC, Alexander Tsoy
Details
samba-3.6.12.ebuild.patch (samba-3.6.12.ebuild.patch,901 bytes, patch)
2013-02-22 21:37 UTC, Alexander Tsoy
Details | Diff
net-fs/samba-3.6.12.ebuild (samba-3.6.12.ebuild,11.95 KB, text/plain)
2013-02-24 17:02 UTC, RedEyedMan
Details
samba.confd (samba.confd,1.26 KB, text/plain)
2013-02-24 17:13 UTC, RedEyedMan
Details
smbd.service (smbd.service,327 bytes, text/plain)
2013-02-26 01:15 UTC, RedEyedMan
Details
nmbd.service (nmbd.service,280 bytes, text/plain)
2013-02-26 01:17 UTC, RedEyedMan
Details
winbind.service (winbind.service,310 bytes, text/plain)
2013-02-26 01:19 UTC, RedEyedMan
Details
samba-3.6.14-r1.ebuild.patch (samba-3.6.14-r1.ebuild.patch,1.08 KB, patch)
2013-05-13 14:43 UTC, Alexander Tsoy
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description RedEyedMan 2012-08-28 16:20:31 UTC
Please add systemd unit file for net-fs/samba.

Thanks for understanding.
Comment 1 RedEyedMan 2012-10-24 15:01:33 UTC
Created attachment 327298 [details]
samba.service

samba.service for systemd created by me.
Comment 2 RedEyedMan 2012-10-24 15:06:11 UTC
Created attachment 327300 [details]
nmbd.service

nmbd.service for systemd created by me.
Comment 3 RedEyedMan 2012-10-24 15:07:29 UTC
Created attachment 327302 [details]
samba.service

samba.service for systemd created by me.
Comment 4 Emery Hemingway 2013-02-01 19:09:04 UTC
Another way to do it is to create smbd.service, nmbd.service, winbind.service, and samba.target. samba.target can Require smbd.service and nmbd.service. If the user wants winbind, they can copy their samba target to /etc/systemd/system and add that to Require from there.

I don't know which way is better and I'm not sure what the systemd policy is on creating new targets.
Comment 5 Alexander Tsoy 2013-02-14 11:49:44 UTC
Created attachment 338852 [details, diff]
samba-3.6.9.ebuild.patch

systemd units already included in release tarball, so only ebuild and conf.d file modifications are needed.
Comment 6 Alexander Tsoy 2013-02-14 11:53:45 UTC
Created attachment 338854 [details, diff]
samba.confd.patch
Comment 7 Alexander Tsoy 2013-02-14 11:56:20 UTC
(In reply to comment #6)
> Created attachment 338854 [details, diff] [details, diff]
> samba.confd.patch

This variables taken from "packaging/systemd/samba.sysconfig"
Comment 8 RedEyedMan 2013-02-15 18:15:31 UTC
Created attachment 339002 [details]
windbd.service
Comment 9 RedEyedMan 2013-02-15 18:18:05 UTC
Created attachment 339004 [details]
smbd.service
Comment 10 RedEyedMan 2013-02-15 18:19:32 UTC
Created attachment 339006 [details]
nmbd.service
Comment 11 Alexander Tsoy 2013-02-22 13:34:44 UTC
Created attachment 339696 [details, diff]
samba-3.6.12.ebuild.patch

Updated patch:
- also change location of PID files, otherwise services won't start
- install winbind.service only if USE=winbind

There is still an issue:
"/var/run/samba" should be created by tmpfiles.d. Another way is to migrate to "/run".

And maybe variables names should be unified between initscripts and units?
Comment 12 Alexander Tsoy 2013-02-22 21:26:14 UTC
Created attachment 339748 [details]
samba.tmpfilesd
Comment 13 Alexander Tsoy 2013-02-22 21:37:48 UTC
Created attachment 339752 [details, diff]
samba-3.6.12.ebuild.patch

- install tmpfiles.d config
Comment 14 RedEyedMan 2013-02-24 17:02:58 UTC
Created attachment 339980 [details]
net-fs/samba-3.6.12.ebuild

Patched with above samba-3.6.12.ebuild.patch
Comment 15 RedEyedMan 2013-02-24 17:13:58 UTC
Created attachment 339982 [details]
samba.confd

Patched with above samba.confd.patch
Comment 16 RedEyedMan 2013-02-26 01:15:49 UTC
Created attachment 340122 [details]
smbd.service

smbd.service  with PIDFile=/var/run/samba due to ebuild
Comment 17 RedEyedMan 2013-02-26 01:17:02 UTC
Created attachment 340124 [details]
nmbd.service

nmbd.service  with PIDFile=/var/run/samba due to ebuild
Comment 18 RedEyedMan 2013-02-26 01:19:16 UTC
Created attachment 340126 [details]
winbind.service

winbind.service  with PIDFile=/var/run/samba due to ebuild
Comment 19 Alexander Tsoy 2013-05-13 14:43:32 UTC
Created attachment 348164 [details, diff]
samba-3.6.14-r1.ebuild.patch

Drop EnvironmentFile option from units. Using distro-cpecific env files is not recommended [1] [2]. Use /etc/systemd/system/{smb,nmb,winbind}.service.d/*.conf files for that purpose.

[1]: https://bugs.gentoo.org/show_bug.cgi?id=459372#c3
[2]: https://fedoraproject.org/wiki/Features/Systemd-unit-cleanup
Comment 20 Pacho Ramos gentoo-dev 2013-07-05 16:57:18 UTC
I would take changes from:
https://github.com/Sabayon/systemd-love/tree/master/net-fs/samba

I will commit in a week if nobody disagrees. Thanks
Comment 21 Pacho Ramos gentoo-dev 2013-07-13 11:21:28 UTC
+  13 Jul 2013; Pacho Ramos <pacho@gentoo.org> +files/nmbd.service,
+  +files/samba.conf, +files/smbd.service, +files/smbd.socket,
+  +files/smbd_at.service, +files/winbindd.service, samba-3.6.16.ebuild,
+  samba-4.0.7.ebuild:
+  Install unit file (#433074)
+