Bug 675778
Summary: | Usability proposal: Automatic notification to desktop user | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Fdor <fdor6> |
Component: | smartmontools | Assignee: | Michal Hlavinka <mhlavink> |
Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 14 | CC: | farrellj, jguenther, kanelxake, mhlavink, palo.simo |
Target Milestone: | --- | Keywords: | Reopened |
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | smartmontools-5.40-6.fc14 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2011-06-11 04:26:12 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Fdor
2011-02-07 18:01:20 UTC
well... this is quite interesting idea, I'll look at it. smartmontools-5.40-6.fc15 has been submitted as an update for Fedora 15. https://admin.fedoraproject.org/updates/smartmontools-5.40-6.fc15 smartmontools-5.40-4.fc14 has been submitted as an update for Fedora 14. https://admin.fedoraproject.org/updates/smartmontools-5.40-4.fc14 smartmontools-5.40-6.fc15 has been pushed to the Fedora 15 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with su -c 'yum --enablerepo=updates-testing update smartmontools'. You can provide feedback for this update here: https://admin.fedoraproject.org/updates/smartmontools-5.40-6.fc15 Will this not duplicate functionality found in gnome-disk-utility on the default GNOME-desktop? I remember getting messages in notification area from gdu when logging in with failing disks, but currently I have none easily connected to test with. the answer is "maybe", but gnome-disk-utility is not used in all desktop environments and also smartd is not installed and running by default, so I don't see any problem here. smartmontools-5.40-6.fc15 has been pushed to the Fedora 15 stable repository. If problems still persist, please make note of it in this bug report. smartmontools-5.40-5.fc14 has been pushed to the Fedora 14 stable repository. If problems still persist, please make note of it in this bug report. A small bug prevents this great usability enhancement from working. The notify script in the package is installed to "/usr/libexec/smartmontools/smartdnotify" but /etc/smartd.conf points at the non-existent "/usr/lib/smartd_actions" proposed script. So, /etc/smartd.conf just needs a small fix to point at the actual script for this to work outofthebox. I see 2 issues: 1. /usr/bin/notify-send requires DISPLAY and XAUTHORITY environment variables and when started at system boot these are not available - so the notifications are not displayed (when the service is restarted from within gnome-terminal, the variables are inherited from it) 2. /usr/libexec/smartmontools/smartdnotify script is not i18n friendly - so the message (when it finally displays, after solving the 1. part) is only in english language (In reply to comment #10) > 1. /usr/bin/notify-send requires DISPLAY and XAUTHORITY environment variables The first problem can at least be worked around by sleeping for a few minutes, giving enough time gdm to start and a user to log in, and then setting the needed env variables ourselves using a "hack", such as: export DISPLAY=:0; export XAUTHORITY=$(ls -td /var/run/gdm/auth*gdm*|head -1)/database; /usr/bin/notify-send -u critical -t 0 'WARNING: Foo!' I knew its going to be complicated :) Maybe wall is better for this than notify-send? Solution from comment #11 works only for gdm, does not work for kdm, so more code is needed (and it'll little bit be more ugly) My present idea is: 1. smartdnotify is called 2. try to get XAUTHORITY and DISPLAY variables 3. if X session is not running, wait (two minutes?) 4. try again to get both variables 5. on success use notify-send 6. on failure use wall any different ideas? comments? That's true, notifications won't be shown because the smartd daemon is started before X, and "notify-send" requires the X session info ($DISPLAY and company) to work. "wall" command doesn't require the X session info, and the notifications will be shown to desktop users too, so probably it's the way to go. Just use the following command at "/usr/libexec/smartmontools/smartdnotify" file: -------------- # Notify desktop user /usr/bin/wall -n "WARNING: Your hard drive is failing. Description: $SMARTD_MESSAGE" -------------- That solves the X session info problem. I only see 3 minor problems: 1. We loose the spetific title at desktop notification ("wall" command only accepts a description). 2. The notification will also appear at text consoles (control+alt+Fx) and at gnome/kde consoles. (maybe an adventage instead of a problem?) 3. If the user is not logged in (gdm/kdm is shown), the notification is lost (it is not saved, to be shown when the user logs in). (it probably also happens with "notify-send") The first two problems seems to be very minor to me. The third problem looks like a pending point in the linux notification system: When no users are logged in, notifications should be stored, in order to be shown when the users log in. Currently, those notifications are lost. I've searched at the internet, but I haven't found any command/way to do it. I'll write a suggestion (to some notification component) to add the notification save/recover idea. In the mean time, I think the "wall" command is the way to go for smartd. Thanks (In reply to comment #9) > A small bug prevents this great usability enhancement from working. The notify > script in the package is installed to "/usr/libexec/smartmontools/smartdnotify" > but /etc/smartd.conf points at the non-existent "/usr/lib/smartd_actions" > proposed script. > > So, /etc/smartd.conf just needs a small fix to point at the actual script for > this to work outofthebox. Yeah, I just ran across this bug when I noticed that 1) my /etc/smartd.conf was wiped out when I updated this package at some point, and 2) the smartd_actions file mentioned above didn't exist, so I didn't get any notification at all. Will this be fixed? I have updated my config but the only reason I noticed was when I had 10 pages of errors in my logwatch. smartd.conf is fixed smartdnotify uses something like "wall" just without wall's ugly header smartmontools-5.40-6.fc14 has been submitted as an update for Fedora 14. https://admin.fedoraproject.org/updates/smartmontools-5.40-6.fc14 smartmontools-5.40-9.fc15 has been submitted as an update for Fedora 15. https://admin.fedoraproject.org/updates/smartmontools-5.40-9.fc15 Package smartmontools-5.40-6.fc14: * should fix your issue, * was pushed to the Fedora 14 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing smartmontools-5.40-6.fc14' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/smartmontools-5.40-6.fc14 then log in and leave karma (feedback). smartmontools-5.40-9.fc15 has been pushed to the Fedora 15 stable repository. If problems still persist, please make note of it in this bug report. smartmontools-5.40-6.fc14 has been pushed to the Fedora 14 stable repository. If problems still persist, please make note of it in this bug report. |