Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 692602 - net-fs/samba-4.8.6-r2: Legacy paths in systemd unit files: nmbd.service, smbd.service, winbindd.service
Summary: net-fs/samba-4.8.6-r2: Legacy paths in systemd unit files: nmbd.service, smbd...
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All All
: Normal normal (vote)
Assignee: Gentoo's SAMBA Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-20 10:06 UTC by Horst Prote
Modified: 2021-09-30 12:34 UTC (History)
2 users (show)

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


Attachments
samba-4.11.4-r1.ebuild (samba-4.11.4-r1.ebuild,9.01 KB, text/plain)
2020-01-07 19:30 UTC, Ben Kohler
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Horst Prote 2019-08-20 10:06:45 UTC
systemd[1]: /lib/systemd/system/nmbd.service:6: PIDFile= references a path below legacy directory /var/run/, updating /var/run/samba/nmbd.pid → /run/samba/nmbd.pid; please update the unit file accordingly.

systemd[1]: /lib/systemd/system/smbd.service:6: PIDFile= references a path below legacy directory /var/run/, updating /var/run/samba/smbd.pid → /run/samba/smbd.pid; please update the unit file accordingly.
Comment 1 Horst Prote 2019-08-20 10:07:53 UTC
systemd[1]: /lib/systemd/system/winbindd.service:6: PIDFile= references a path below legacy directory /var/run/, updating /var/run/samba/winbindd.pid → /run/samba/winbindd.pid; please update the unit file accordingly.
Comment 2 René Fuchs 2019-11-04 09:21:42 UTC
we are already at 4.11.2, will this be fixed?
Comment 3 Ben Kohler gentoo-dev 2020-01-07 17:45:45 UTC
FWIW the upstream supplied units have the correct paths but we're not installing those.  They have different names than our units too, so we either need to rename upstream's to our names, or have some method to migrate people to the new units.
Comment 4 Ben Kohler gentoo-dev 2020-01-07 19:30:03 UTC
Created attachment 602762 [details]
samba-4.11.4-r1.ebuild

Can you test the attached ebuild which uses upstream's units & unit naming, and also preserves functionality via the old names? Seems to work well here.

Ebuild changes are:

--- a/net-fs/samba/samba-4.11.4.ebuild
+++ b/net-fs/samba/samba-4.11.4-r1.ebuild
@@ -209,6 +209,8 @@
                $(multilib_native_use_with quota quotas)
                $(multilib_native_use_with syslog)
                $(multilib_native_use_with systemd)
+               --systemd-install-services
+               --with-systemddir="$(systemd_get_systemunitdir)"
                $(multilib_native_use_with winbind)
                $(multilib_native_usex python '' '--disable-python')
                $(multilib_native_use_enable zeroconf avahi)
@@ -264,12 +266,12 @@
                newinitd "${CONFDIR}/samba4.initd-r1" samba
                newconfd "${CONFDIR}/samba4.confd" samba
 
-               systemd_dotmpfilesd "${FILESDIR}"/samba.conf
-               systemd_dounit "${FILESDIR}"/nmbd.service
-               systemd_dounit "${FILESDIR}"/smbd.{service,socket}
-               systemd_newunit "${FILESDIR}"/smbd_at.service 'smbd@.service'
-               systemd_dounit "${FILESDIR}"/winbindd.service
-               systemd_dounit "${FILESDIR}"/samba.service
+               systemd_newtmpfilesd packaging/systemd/samba.conf.tmp samba.conf
+               # Preserve functionality for old gentoo-specific unit names
+               dosym nmb.service "$(systemd_get_systemunitdir)/nmbd.service"
+               dosym smb.service "$(systemd_get_systemunitdir)/smbd.service"
+               dosym winbind.service "$(systemd_get_systemunitdir)/winbindd.service"
+
        fi
 
        if use pam && use winbind ; then
Comment 5 Sebastian Pucilowski 2020-02-07 23:00:15 UTC
Also had this issue for a long time.
Comment 6 Ben Kohler gentoo-dev 2020-02-07 23:02:13 UTC
Have you tested the above ebuild which has a fix?  I'd like to get this merged to the latest ebuild soon but I really want someone besides myself to test & report success.
Comment 7 Julien Delquié 2020-02-09 08:36:34 UTC
Hello  Ben Kohler,

I just tested your patch this morning on my system.
It greatly works just as expected.

Please, don't hesitate to merge it in the latest ebuild. :)
Comment 8 Julien Delquié 2020-02-09 09:55:44 UTC
Mmmh, except that /usr/lib/tmpfiles.d/samba.conf is not updated.

systemd-tmpfiles	/usr/lib/tmpfiles.d/samba.conf:1: Line references path below legacy directory /var/run/, updating /var/run/samba → /run/samba; please update the tmpfiles.d/ drop-in file accordingly.
Comment 9 Larry the Git Cow gentoo-dev 2020-02-09 14:46:57 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6a19e6bd0004fdf91141e798b405b069412fa114

commit 6a19e6bd0004fdf91141e798b405b069412fa114
Author:     Ben Kohler <bkohler@gentoo.org>
AuthorDate: 2020-02-09 14:40:02 +0000
Commit:     Ben Kohler <bkohler@gentoo.org>
CommitDate: 2020-02-09 14:46:38 +0000

    net-fs/samba: revbump to switch to upstream's systemd units
    
    Switch to upstream's packaged systemd units with new filenames.  Add
    symlinks to preserve existing setups.  Remove unused samba.service when
    addc is disabled.  Fix minor whitespace issue in IUSE.
    
    Bug: https://bugs.gentoo.org/692602
    Closes: https://bugs.gentoo.org/573976
    Package-Manager: Portage-2.3.88, Repoman-2.3.20
    Signed-off-by: Ben Kohler <bkohler@gentoo.org>

 net-fs/samba/samba-4.11.6-r1.ebuild | 314 ++++++++++++++++++++++++++++++++++++
 1 file changed, 314 insertions(+)
Comment 10 Ben Kohler gentoo-dev 2020-02-09 14:48:37 UTC
I have pushed a 4.11.6-r1 ebuild with upstream's units but still using gentoo's tmpfilesd config to address comment #8.  Please test again and let me know if you see any more problems.
Comment 11 Julien Delquié 2020-02-09 18:08:44 UTC
I have updated to 4.11.6-r1.
It just works has expected!