New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Path to system_bus_socket #77

Closed
cwilling opened this Issue Sep 26, 2018 · 3 comments

Comments

Projects
None yet
2 participants
@cwilling
Copy link
Contributor

cwilling commented Sep 26, 2018

The path to dbus' system_bus_socket is currently hard coded to /run/dbus/system_bus_socket in two locations, namely src/basic/def.h and src/libelogind/sd-bus/test-bus-vtable.c. The first of these files comments that we use the new /run prefix here (instead of /var/run) since we require them to be aliases and that way we become independent of /var being mounted. I suspect this is a systemd "requirement" rather than FHS which states It is valid to implement /var/run as a symlink to /run. i.e. valid, not required. In any case, not all distros support that requirement and instead have a separate /run & /var/run and have dbus directory in /var/run, hence use /var/run/dbus/system_bus_socket. Although an extra symlink to support the hard coded path can be added to the affected system, it would be nicer if the code could already reflect the "correct" path at build time.

Would you consider a PR that detects whether /var/run is a symlink (follows the systemd "requirement") or not and then defines the system_bus_socket path accordingly? i.e.

/var/run is a symlink => path is /run/dbus/system_bus_socket
/var/run not symlink => path is /var/run/dbus/system_bus_socket

@Yamakuzure

This comment has been minimized.

Copy link
Collaborator

Yamakuzure commented Sep 26, 2018

@cwilling

Would you consider a PR

Of course I would! I don't like hard-coded paths either.

Please make sure that the changes are masked in the same scheme as they are now:

To take something out and substitute it:

#if 0 /// some text (must include the keyword elogind) describing why this upstream part is masked
(... original code ; this must not be changed ...)
#else
(... substituting code specific to elogind ...)
#endif // 0

The #else part is optional of course.

And for additional code:

#if 1 /// some text (must include the keyword elogind) describing why this code is needed
(... additional code specific to elogind ...)
#endif // 1

This scheme is needed, so my migration tools can migrate upstream patches mostly automatic. Further more there are sometimes masked parts that get fixed by upstream, that then have changes I need to "transfer" into the elogind specific code. Easiest (and most reliable) way to do this is to have the code right there between #if 0 / #endif tags.

cwilling added a commit to cwilling/elogind that referenced this issue Sep 26, 2018

Enable system_bus_socket to be found in /var/run/dbus as well as /run…
…/dbus.

Fixes issue elogind#77

Signed-off-by: Christoph Willing <chris.willing@linux.com>

Yamakuzure added a commit that referenced this issue Sep 26, 2018

Support system_bus_socket to be found in /var/run/dbus as well as /ru…
…n/dbus.

Currently the path to system_bus_socket is hardcoded to
  /run/dbus/system_bus_socket
which works everywhere for systemd.

However, distributions which do no symlink /var/run on /run will have
it only accessible via
  /run/dbus/system_bus_socket
which should be supported by elogind, too.

Closes #77

Signed-off-by: Christoph Willing <chris.willing@linux.com>
Sigend-off-by: Sven Eden <sven.eden@prydeworx.com>

Yamakuzure added a commit that referenced this issue Sep 26, 2018

Support system_bus_socket to be found in /var/run/dbus as well as /ru…
…n/dbus.

Currently the path to system_bus_socket is hardcoded to
  /run/dbus/system_bus_socket
which works everywhere for systemd.

However, distributions which do no symlink /var/run on /run will have
it only accessible via
  /run/dbus/system_bus_socket
which should be supported by elogind, too.

Closes #77

Signed-off-by: Christoph Willing <chris.willing@linux.com>
Sigend-off-by: Sven Eden <sven.eden@prydeworx.com>
@Yamakuzure

This comment has been minimized.

Copy link
Collaborator

Yamakuzure commented Sep 27, 2018

@cwilling @perfect7gentleman : I have written a blog post about the three issues we fixed by yesterday here:
https://prydeworx.com/2018/elogind-bug-fix-wednesday-glibc-meson-dbus/

It is a very new site, so I'd like your opinions whether you are okay with the wording and how I mentioned you two, if you can spare the time.
Thanks alot!

@cwilling

This comment has been minimized.

Copy link
Contributor Author

cwilling commented Sep 27, 2018

That's fine with me - thanks for the mention.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment