Bug 1303359 - [Zenity] DBUS_SESSION_BUS_ADDRESS not set for ssh, systemd service or cronjob
[Zenity] DBUS_SESSION_BUS_ADDRESS not set for ssh, systemd service or cronjob
Status: CLOSED EOL
Product: Fedora
Classification: Fedora
Component: openssh (Show other bugs)
23
x86_64 Linux
unspecified Severity unspecified
: ---
: ---
Assigned To: Jakub Jelen
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-01-31 06:05 EST by srakitnican
Modified: 2016-12-20 14:02 EST (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-12-20 13:20:08 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description srakitnican 2016-01-31 06:05:38 EST
Description of problem: By logging in from remote computer over ssh and setting DISPLAY variable to :0 in order to use local X applications, zenity is unable to work entirely. For example "zenity --question" works and displays a dialog, while "zenity --notification --text 'Text'" throws an error and nothing happens.

$ zenity --question                                       
Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged.

$ zenity --notification --text "Test"

** (zenity:4035): WARNING **: Error showing notification: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.Notifications was not provided by any .service files


Version-Release number of selected component (if applicable):
zenity-3.18.1.1-1.fc23.x86_64

How reproducible: Always


Steps to Reproduce:
1. Login To computer A from remote computer B using ssh
2. Set DISPLAY variable to :0
3. Try to use zenity

Actual results:


Expected results:


Additional info:
Comment 1 srakitnican 2016-02-05 07:42:09 EST
The cause for this issue is that environment variable DBUS_SESSION_BUS_ADDRESS is not set for user ssh session, cronjob or systemd service file. None of these works with zenity --notification or notify-send.

By user I mean I have used this services as the same user that owns the Desktop.
Comment 2 srakitnican 2016-02-05 07:43:49 EST
Background: http://forums.fedoraforum.org/showthread.php?t=308669
Comment 3 Matthias Clasen 2016-02-12 11:34:57 EST
There is nothing zenity can do about this. This is just the way ssh sessions work - they don't forward the session bus. Changing that would require changes in openssh.
Comment 4 srakitnican 2016-02-12 13:11:55 EST
I personally could live without ssh session support, but the most useful thing for zenity is background scripts and user notification. Right now it doesn't work from user cron jobs or user system service if DBUS_SESSION_BUS_ADDRESS is not provided for which I found methods to set it only in some hackish ways [1]?

I have noticed systemd --user already sets variables for DISPLAY and XAUTHORITY [2], could it also set variable for DBUS_SESSION_BUS_ADDRESS?

Or why zenity dialogs works fine with just DISPLAY variable set while --notification requires also DBUS_SESSION_BUS_ADDRESS. Could it be done in some other way to make it more simple and not require additional environment variable which is not available by default?



[1] http://ubuntuforums.org/showthread.php?t=1727148&p=10675502#post10675502
[2] https://github.com/systemd/systemd/blob/v219/NEWS#L194
Comment 5 Jakub Jelen 2016-05-06 04:00:05 EDT
I don't think this is anything we would be implementing in openssh. As far as I understand it it would require D-bus tunneling (over secure channel) between remote (where zenity is running) and your desktop (where notification is shown). It is something different than only X11 forwarding.

It might be possible, if you forward the port using SSH RemotePortForwarding, but I was unable to make it work. There is nice information guide about RemoteDBus [1]. You might be more lucky if you try to check with systemd guys.

[1] https://www.freedesktop.org/wiki/Software/DBusRemote/
Comment 6 Fedora Update System 2016-07-27 06:40:36 EDT
openssh-7.2p2-11.fc24 selinux-policy-3.13.1-191.8.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-99191c4aab
Comment 7 Lukas Vrabec 2016-07-27 06:52:11 EDT
Reverting to NEW state. BZ was switched to MODIFIED due to wrong bodhi update.
Comment 8 Fedora End Of Life 2016-11-24 10:18:32 EST
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. 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 '23'.

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 23 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 9 Fedora End Of Life 2016-12-20 13:20:08 EST
Fedora 23 changed to end-of-life (EOL) status on 2016-12-20. Fedora 23 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.
Comment 10 srakitnican 2016-12-20 14:02:47 EST
Not sure if it was fixed by someone intentionally, it seems it is working without having to set DBUS_SESSION_BUS_ADDRESS.

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