Skip to content
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

user-services.md: add session dbus and ssh example #785

Closed
wants to merge 1 commit into from

Conversation

tjheeta
Copy link

@tjheeta tjheeta commented Dec 8, 2023

Added examples for setting up a session dbus and ssh-agent via user-services. References to setting up a session dbus were made in pipewire.md and session-management.md .

Added examples for setting up a session dbus and ssh-agent via
user-services. References to setting up a session dbus were made in
pipewire.md and session-management.md .
@tjheeta
Copy link
Author

tjheeta commented Dec 8, 2023

I spent a few hours struggling with dbus until someone explained in irc how dbus was supposed to work. For instance, I was launching applications with dbus-launch and dbus-run-session to get them to connect to user dbus.

With that in mind, I was considering adding the following blurb to session-management.md:

... in Linux. D-Bus can provide a system bus and/or a session bus, the
latter being specific to a user session.

The system bus is provided by /etc/sv/dbus and listens on /run/dbus/system_bus_socket. The session bus does not have a set location, but provides DBUS_SESSION_BUS_ADDRESS for any applications to find the listening socket. Note that for the session dbus to work as designed there can only be one instance per user account and DBUS_SESSION_BUS_ADDRESS must be in the environment of all dbus-using programs of that user pointing to the listening socket.

To provide ...

Not sure if this belongs in a different PR or not.

Copy link
Member

@ahesford ahesford left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should be encouraging users to manage D-Bus as a user service when we don't have an officially supported mechanism for managing user services. While we note that the user-specific runsvdir is viable, it also has some caveats (for example, the D-Bus service that you provide has no means to reliably check if the service is functional). dbus-run-session is the most reliable method to ensure that the bus is functional when needed, and that's especially important for inexperienced users who are more likely to naively follow instructions in the documentation.

Furthermore, I don't think providing two arbitrary examples is particularly helpful. It might be better instead to note that user services are constructed in the same fashion as system services and advise users to consult those services for examples. People designing custom services will need to manage them, and it is better to foster a deeper understanding of things they will write than encouraging people to copy a simple example.

@tjheeta tjheeta closed this Apr 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants