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