Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1557622 - /usr/lib/systemd/system/sssd-secrets.socket references "/var/run" instead of "/run"
Summary: /usr/lib/systemd/system/sssd-secrets.socket references "/var/run" instead of ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: sssd
Version: 32
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Pavel Březina
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1707862 1722123 1729727 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-03-17 09:02 UTC by dac.override
Modified: 2020-07-30 18:56 UTC (History)
21 users (show)

Fixed In Version: sssd-2.3.1-2.fc32
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-07-30 18:56:38 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description dac.override 2018-03-17 09:02:04 UTC
Description of problem:
/usr/lib/systemd/system/sssd-secrets.socket references "/var/run" instead of "/run"

When possible "/run" should be referenced instead of "/var/run". "/var/run" is legacy and the "/var/run/" symlink is there for scenario's where there is no other option (API compatibility). In other scenarios "/run" should be used

Referencing "/var/run" in systemd socket units and systemd-tmpfiles snippets can cause issues do to the way systemd and systemd-tmpfiles process these files.

Version-Release number of selected component (if applicable):
sssd-common-1.16.1-1.fc28.x86_64

Comment 1 Lukas Slebodnik 2018-03-17 09:14:36 UTC
I can see many packages on rawhide which still use /var/run (which is a symbolic link to /run)

sh$ grep -RniI "/var/run/" /usr/lib/systemd/system
/usr/lib/systemd/system/sysinit.target.wants/plymouth-start.service:10:ExecStart=/usr/sbin/plymouthd --mode=boot --pid-file=/var/run/plymouth/pid --attach-to-session
/usr/lib/systemd/system/initrd-switch-root.target.wants/plymouth-start.service:10:ExecStart=/usr/sbin/plymouthd --mode=boot --pid-file=/var/run/plymouth/pid --attach-to-session
/usr/lib/systemd/system/oddjobd.service:7:PIDFile=/var/run/oddjobd.pid
/usr/lib/systemd/system/oddjobd.service:8:ExecStart=/usr/sbin/oddjobd -n -p /var/run/oddjobd.pid -t 300
/usr/lib/systemd/system/mdmonitor.service:7:PIDFile=/var/run/mdadm/mdadm.pid
/usr/lib/systemd/system/mdmonitor.service:9:ExecStart=/sbin/mdadm --monitor --scan -f --pid-file=/var/run/mdadm/mdadm.pid
/usr/lib/systemd/system/chronyd.service:10:PIDFile=/var/run/chronyd.pid
/usr/lib/systemd/system/plymouth-start.service:10:ExecStart=/usr/sbin/plymouthd --mode=boot --pid-file=/var/run/plymouth/pid --attach-to-session
/usr/lib/systemd/system/iscsiuio.service:13:PIDFile=/var/run/iscsiuio.pid
/usr/lib/systemd/system/iscsid.service:11:PIDFile=/var/run/iscsid.pid
/usr/lib/systemd/system/irda.service:7:PIDFile=/var/run/irattach.pid
/usr/lib/systemd/system/radvd.service:9:PIDFile=/var/run/radvd/radvd.pid
/usr/lib/systemd/system/spice-vdagentd.service:11:ExecStartPre=/bin/rm -f /var/run/spice-vdagentd/spice-vdagent-sock
/usr/lib/systemd/system/spice-vdagentd.service:13:PIDFile=/var/run/spice-vdagentd/spice-vdagentd.pid
/usr/lib/systemd/system/tog-pegasus.service:9:PIDFile=/var/run/tog-pegasus/cimserver.pid
/usr/lib/systemd/system/pcscd.socket:5:ListenStream=/var/run/pcscd/pcscd.comm
/usr/lib/systemd/system/virtlockd-admin.socket:6:ListenStream=/var/run/libvirt/virtlockd-admin-sock
/usr/lib/systemd/system/virtlockd.socket:6:ListenStream=/var/run/libvirt/virtlockd-sock
/usr/lib/systemd/system/virtlogd-admin.socket:6:ListenStream=/var/run/libvirt/virtlogd-admin-sock
/usr/lib/systemd/system/virtlogd.socket:6:ListenStream=/var/run/libvirt/virtlogd-sock
/usr/lib/systemd/system/openhpid.service:7:PIDFile=/var/run/openhpid.pid
/usr/lib/systemd/system/sssd-secrets.socket:6:ListenStream=/var/run/secrets.socket
/usr/lib/systemd/system/sssd.service:13:PIDFile=/var/run/sssd.pid
/usr/lib/systemd/system/sssd-kcm.socket:7:ListenStream=/var/run/.heim_org.h5l.kcm-socket
/usr/lib/systemd/system/cups.socket:6:ListenStream=/var/run/cups/cups.sock
/usr/lib/systemd/system/certmonger.service:7:PIDFile=/var/run/certmonger.pid
/usr/lib/systemd/system/certmonger.service:9:ExecStart=/usr/sbin/certmonger -S -p /var/run/certmonger.pid -n $OPTS
/usr/lib/systemd/system/auditd.service:16:PIDFile=/var/run/auditd.pid
/usr/lib/systemd/system/gssproxy.service:13:PIDFile=/var/run/gssproxy.pid
/usr/lib/systemd/system/nfs-blkmap.service:12:PIDFile=/var/run/blkmapd.pid
/usr/lib/systemd/system/nfs-lock.service:18:PIDFile=/var/run/rpc.statd.pid
/usr/lib/systemd/system/rpc-statd.service:18:PIDFile=/var/run/rpc.statd.pid
/usr/lib/systemd/system/fancontrol.service:8:PIDFile=/var/run/fancontrol.pid
/usr/lib/systemd/system/kadmin.service:9:PIDFile=/var/run/kadmind.pid
/usr/lib/systemd/system/kadmin.service:11:ExecStart=/usr/sbin/kadmind -P /var/run/kadmind.pid $KADMIND_ARGS
/usr/lib/systemd/system/krb5kdc.service:8:PIDFile=/var/run/krb5kdc.pid
/usr/lib/systemd/system/krb5kdc.service:10:ExecStart=/usr/sbin/krb5kdc -P /var/run/krb5kdc.pid $KRB5KDC_ARGS

Comment 2 Lukas Slebodnik 2018-03-17 09:17:48 UTC
I tried to find something in fedora packaging guidelines for systemd[1].
But I cannot see any explicit note about /run/ vs /var/run.

Zbigniew,
could you provide your opinion from systemd POV?


[1] https://fedoraproject.org/wiki/Packaging:Systemd?rd=Packaging:Guidelines:Systemd

Comment 3 dac.override 2018-03-17 09:18:54 UTC
I know (believe me). I am addressing these issues on a case-by-case basis.

The entries with PIDFile arent important (but one should use /run there aswell while one is at it) since systemd only reads and deletes pidfiles.

The named-socket entries with "ListenStream" are important because systemd creates these on behalf of the service. THe way systemd does this *can* cause issues in some scenario's

Comment 4 dac.override 2018-03-17 09:28:06 UTC
If you want to here the long explanation:

Were trying to migrate away from /var/run to /run (since about half a decade). However some components force us to keep a /var/run symlink for compatibility (API breakage). However eventually the idea is to get rid of /var/run

If everyone just keeps using /var/run out of habit, then that does not help.

The real issue is this:

Some components are SELinux aware (example: systemd, systemd-tmpfiles, rpm)
These components sometimes interpret configuration (units, tmpfiles config, rpm specs) and process these configs accordingly.

A tmpfs file system is mounted on /run, an extended attribute file system is mounted on /, /var, /var/run

Take for example the sssd-secrets.socket unit:

You tell systemd to create /var/run/sssd-secrets.socket
systemd calls selinux and asks selinux: "hey i am about to create this socket, what context should i associate with that socket?"
If the selinux policy does not know about /var/run then SELinux will tell systemd to use a label for /var since /var/run is just a link file on /var.
This label might then not be allowed to associate with the underlying filesystem (tmpfs) mounted on /run. Because it does not make sense for "var" contexts to associate with tmpfs file systems.

So systemd will not be allowed to create the socket with the wrong context, and sssd does not start etc etc.

But really, all this aside. Just use /run and forget about /var/run unless you are forced by API's to use /var/run. Then maybe one day we will be able to get rid of /var/run

Comment 5 Zbigniew Jędrzejewski-Szmek 2018-03-17 10:43:47 UTC
What dac.override said.

Also, /run is mounted very early, but /var is sometimes mounted later. For a majority of services this doesn't matter, because they are started later, but going through /var adds an additional dependency.

tl;dr version is that most of the time they are equivalent, but in various corner cases they are not, so it's cleaner and better to use /run.

Comment 6 Zbigniew Jędrzejewski-Szmek 2018-03-17 10:44:31 UTC
Oh, and a Guidelines link:
https://fedoraproject.org/wiki/Packaging:Guidelines#.2Frun
> /var/run is a legacy symlink to /run

Comment 7 Cole Robinson 2018-03-24 20:30:10 UTC
I'm coming here from a similar request for libvirt: https://bugzilla.redhat.com/show_bug.cgi?id=1554079

Is the /run convention used by every systemd distro, presumably it's not just a fedora thing?

Comment 8 Lukas Slebodnik 2018-03-24 23:00:46 UTC
(In reply to Cole Robinson from comment #7)
> I'm coming here from a similar request for libvirt:
> https://bugzilla.redhat.com/show_bug.cgi?id=1554079
> 
> Is the /run convention used by every systemd distro, presumably it's not
> just a fedora thing?

I do not know but that can be easily solved at configure time with --runstatedir
which will be introduced in autoconf 2.70.

So my patch just allows to use change that to runstatedir instead of using
$(localstatedir)/run.
https://pagure.io/SSSD/sssd/pull-request/3689

And sssd would still use /var/run by default due to following fallback
https://pagure.io/SSSD/sssd/blob/master/f/src/conf_macros.m4#_884

And in case of somebody would like to test it then it can be changed at spec file
diff --git a/sssd.spec b/sssd.spec
index 25314596b..dfe31c7ff 100644
--- a/contrib/sssd.spec.in
+++ b/contrib/sssd.spec.in
@@ -743,6 +743,7 @@ autoreconf -ivf
     --enable-nsslibdir=/%{_lib} \
     --enable-pammoddir=/%{_lib}/security \
     --enable-nfsidmaplibdir=%{_libdir}/libnfsidmap \
+    --with-pid-path=/run \
     --disable-static \
     --disable-rpath \
 %if %{with sssd_user}
@@ -758,7 +759,8 @@ autoreconf -ivf
     %{?with_kcm_option} \
     %{?experimental}
 
-make %{?_smp_mflags} all
+make %{?_smp_mflags} all \
+     runstatedir=/run

 

But IMHO we should wait till autoconf 2.70 and have runstatedir configured in
rpm macro "%configure"

Comment 9 Lukas Slebodnik 2018-03-27 20:07:14 UTC
(In reply to Lukas Slebodnik from comment #8)
> (In reply to Cole Robinson from comment #7)
> > I'm coming here from a similar request for libvirt:
> > https://bugzilla.redhat.com/show_bug.cgi?id=1554079
> > 
> > Is the /run convention used by every systemd distro, presumably it's not
> > just a fedora thing?
> 
> I do not know but that can be easily solved at configure time with
> --runstatedir
> which will be introduced in autoconf 2.70.
> 
> So my patch just allows to use change that to runstatedir instead of using
> $(localstatedir)/run.
> https://pagure.io/SSSD/sssd/pull-request/3689
> 
Fixing link to PR https://pagure.io/SSSD/sssd/pull-request/3691

> And sssd would still use /var/run by default due to following fallback
> https://pagure.io/SSSD/sssd/blob/master/f/src/conf_macros.m4#_884
> 
> And in case of somebody would like to test it then it can be changed at spec
> file
> diff --git a/sssd.spec b/sssd.spec
> index 25314596b..dfe31c7ff 100644
> --- a/contrib/sssd.spec.in
> +++ b/contrib/sssd.spec.in
> @@ -743,6 +743,7 @@ autoreconf -ivf
>      --enable-nsslibdir=/%{_lib} \
>      --enable-pammoddir=/%{_lib}/security \
>      --enable-nfsidmaplibdir=%{_libdir}/libnfsidmap \
> +    --with-pid-path=/run \
>      --disable-static \
>      --disable-rpath \
>  %if %{with sssd_user}
> @@ -758,7 +759,8 @@ autoreconf -ivf
>      %{?with_kcm_option} \
>      %{?experimental}
>  
> -make %{?_smp_mflags} all
> +make %{?_smp_mflags} all \
> +     runstatedir=/run
> 
>  
> 
> But IMHO we should wait till autoconf 2.70 and have runstatedir configured in
> rpm macro "%configure"

BTW previous "patch" for spec would work only until removing symlink /var/run because krb5 has hardcoded path to kCM socket /var/run/.heim_org.h5l.kcm-socket

And because /etc/krb5.conf.d/kcm_default_ccache is marked as %config(noreplace) we would need to either coordinate change together with krb5 or use another krb5 config file to use new path for kcm socket.

Anyway, I hope that removing symlink /var/run will be done in fedora as "System Wide Change". So far I cannot see it in f29 one. http://fedoraproject.org/wiki/Releases/29/ChangeSet

Comment 10 Zbigniew Jędrzejewski-Szmek 2018-03-27 20:21:20 UTC
> Anyway, I hope that removing symlink /var/run will be done in fedora as "System Wide Change".

That's not going to happen, at least in the foreseeable future. Countless things would be broken.

Comment 11 dac.override 2018-03-28 10:00:23 UTC
That is also not what I am requesting this for (although I see how this is related). I just would like rpm specs, systemd socket units and tmpfiles snippets to reference /run instead of /var/run where possible. The symlink itself is not a big issue for me.

Comment 12 Ben Cotton 2019-05-02 19:51:13 UTC
This message is a reminder that Fedora 28 is nearing its end of life.
On 2019-May-28 Fedora will stop maintaining and issuing updates for
Fedora 28. It is Fedora's policy to close all bug reports from releases
that are no longer maintained. At that time this bug will be closed as
EOL if it remains open with a Fedora 'version' of '28'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 28 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 13 Lukas Slebodnik 2019-05-09 07:16:06 UTC
*** Bug 1707862 has been marked as a duplicate of this bug. ***

Comment 14 Jakub Hrozek 2019-05-09 07:55:51 UTC
This appears to have been fixed in b2e48deec7feaeca2824835caf38e1f26f146c50 at least in one of the services. Not sure if more work is needed..

Comment 15 Claude Frantz 2019-05-14 10:57:39 UTC
I'm running version 30 and such warnings about PIDFile are numerous in the log.

Comment 16 Michal Schorm 2019-05-31 01:14:05 UTC
Fedora 30; dmesg:
systemd[1]: /usr/lib/systemd/system/sssd.service:11: PIDFile= references path below legacy directory /var/run/, updating /var/run/sssd.pid → /run/sssd.pid; please update the unit file accordingly.

Comment 17 Michal Halenka 2019-06-04 12:41:56 UTC
Confirming presence on Fedora 30

Comment 18 Lukas Slebodnik 2019-06-19 14:20:25 UTC
*** Bug 1722123 has been marked as a duplicate of this bug. ***

Comment 19 Lukas Slebodnik 2019-07-16 15:16:36 UTC
*** Bug 1729727 has been marked as a duplicate of this bug. ***

Comment 20 Ömer Fadıl Usta 2019-07-19 00:42:55 UTC
Comfirming presence on Fedora 31 (Rawhide)

Comment 21 Ben Cotton 2019-10-31 18:52:52 UTC
This message is a reminder that Fedora 29 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 29 on 2019-11-26.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '29'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 29 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 22 Ömer Fadıl Usta 2019-10-31 19:27:53 UTC
Could we change the version from 29 to 31 or 32?

Comment 23 James Cassell 2020-04-15 23:22:26 UTC
Apr 15 23:09:25 localhost.localdomain systemd[1]: /usr/lib/systemd/system/sssd.service:13: PIDFile= references a path below legacy directory /var/run/, updating /var/run/sssd.pid → /run/sssd.pid; please update the unit file accordingly.
Apr 15 23:09:25 localhost.localdomain systemd[1]: /usr/lib/systemd/system/sssd-kcm.socket:7: ListenStream= references a path below legacy directory /var/run/, updating /var/run/.heim_org.h5l.kcm-socket → /run/.heim_org.h5l.kcm-socket; please update the unit file accordingly.

Comment 24 David Jansen 2020-05-11 14:22:54 UTC
Debugging another sssd issue, I was reminded of how annoying it was that the journal has so may of these legacy /var/run warnings.
Is there any reason why this setting in the sssd service units cannot be changed? I see the point of the system wide change not happening yet, but converting one service at a time to get one step closer to using /run everywhere, and getting rid of needless warnings in the journal as well

Comment 25 Zbigniew Jędrzejewski-Szmek 2020-05-11 14:25:11 UTC
Frankly, I have no idea. It's a five minute operation for the authors of a service (with most of the time
spent on writing the commit message). Having a bug like this open for 26+ months is beyond me.

Comment 26 Pavel Březina 2020-07-24 15:14:39 UTC
Hmm, this has been actually fixed upstream for more then two years but apparently the previous maintainer forgot to patch spec file to include this change. I'm going to do new release soon so I will include it.

Comment 27 Lukas Slebodnik 2020-07-27 12:03:10 UTC
(In reply to Pavel Březina from comment #26)
> Hmm, this has been actually fixed upstream for more then two years but
> apparently the previous maintainer forgot to patch spec file to include this
> change. I'm going to do new release soon so I will include it.

Patch was pushed just to f32. But it is missing in rawhide and f31.
Rawhide is more critical.

Comment 28 Fedora Update System 2020-07-29 13:16:55 UTC
FEDORA-2020-63a418c824 has been submitted as an update to Fedora 32. https://bodhi.fedoraproject.org/updates/FEDORA-2020-63a418c824

Comment 29 Fedora Update System 2020-07-30 18:56:38 UTC
FEDORA-2020-63a418c824 has been pushed to the Fedora 32 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.