Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1834682

Summary: [RFE] notify-send should return nonzero value if the notification was not sent
Product: Red Hat Enterprise Linux 8 Reporter: Ondrej <ondrej.valousek.xm>
Component: libnotifyAssignee: Ray Strode [halfline] <rstrode>
Status: CLOSED ERRATA QA Contact: Tomas Pelka <tpelka>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.2CC: modehnal, tpelka
Target Milestone: rcKeywords: FutureFeature
Target Release: 8.0Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libnotify-0.7.7-6.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2017158 (view as bug list) Environment:
Last Closed: 2022-05-10 13:44:22 UTC Type: Feature Request
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ondrej 2020-05-12 08:36:48 UTC
Actual results:
Currently, notify-send always returns zero, regardless of the actual success in the notification.


Expected results:
Ideally, it should return non-zero if the notification was not sent (i.e. no dbus connection or such)


Additional info:

Comment 3 Michal Odehnal 2020-05-12 09:51:36 UTC
Can you provide some reproducer for this issue? Do you have something in logs or something of an indication that it was sent but the notification did not go through? I am not sure how to start reproducing this. What came to mind was to stop message bus, send the notification and check the return message, but the bus could be back up before the notification actually goes through.

systemctl stop messagebus;notify-send -u CRITICAL ABC; echo $?

It would be of great value to have some better reproducer. Thanks

Comment 4 Ondrej 2020-05-12 10:16:54 UTC
Well, it seems the issue is easy to reproduce - ssh to a RH-8 box, then execute 'notify-send  "hello world"'.
Ideally, this should return a failure as no GUI (Gnome session) running so nowhere to display the message.
Is it possible to achieve?

Also, easier test:
$ export DBUS_SESSION_BUS_ADDRESS=nonsense
$ notify-send "hello world"
- returns 0, should return non-zero as invalid DBUS configured

Comment 15 errata-xmlrpc 2022-05-10 13:44:22 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (libnotify bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:1818