From eaa1acf49fac417f9fc1720cf7f3fce99949faaa Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Mon, 16 May 2011 15:38:58 +0200 Subject: [PATCH] fix path to notify script (#675778) --- smartdnotify | 10 ++++++++-- smartmontools-5.38-defaultconf.patch | 2 +- smartmontools.spec | 5 ++++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/smartdnotify b/smartdnotify index b03ae26..b789c72 100644 --- a/smartdnotify +++ b/smartdnotify @@ -4,6 +4,12 @@ echo "$SMARTD_MESSAGE" | mail -s "$SMARTD_FAILTYPE" "$SMARTD_ADDRESS" # Notify desktop user -/usr/bin/notify-send -t 0 "WARNING: Your hard drive is failing" "Description: -$SMARTD_MESSAGE" >/dev/null 2>&1 ||: +MESSAGE="WARNING: Your hard drive is failing" + +# direct write to terminals, do not use 'wall', because we don't want its ugly header +for t in $(who | awk '{ print $2; }' | grep -e '^tty' -e '^pts/') +do + echo "$MESSAGE +$SMARTD_MESSAGE" >/dev/$t 2>/dev/null ||: +done diff --git a/smartmontools-5.38-defaultconf.patch b/smartmontools-5.38-defaultconf.patch index 28d382b..22121a6 100644 --- a/smartmontools-5.38-defaultconf.patch +++ b/smartmontools-5.38-defaultconf.patch @@ -6,7 +6,7 @@ diff -up smartmontools-5.38/smartd.conf.defaultconf smartmontools-5.38/smartd.co # are found. Most users should comment out DEVICESCAN and explicitly # list the devices that they wish to monitor. -DEVICESCAN -+DEVICESCAN -H -m root -M exec /usr/lib/smartd_actions -n standby,10,q ++DEVICESCAN -H -m root -M exec /usr/libexec/smartmontools/smartdnotify -n standby,10,q # Alternative setting to ignore temperature and power-on hours reports # in syslog. diff --git a/smartmontools.spec b/smartmontools.spec index e1b6884..a66f461 100644 --- a/smartmontools.spec +++ b/smartmontools.spec @@ -1,7 +1,7 @@ Summary: Tools for monitoring SMART capable hard disks Name: smartmontools Version: 5.40 -Release: 9%{?dist} +Release: 10%{?dist} Epoch: 1 Group: System Environment/Base License: GPLv2+ @@ -117,6 +117,9 @@ fi %{_datadir}/%{name} %changelog +* Mon May 16 2011 Michal Hlavinka - 1:5.40-10 +- fix path to notify script (#675778) + * Fri Mar 11 2011 Michal Hlavinka - 1:5.40-9 - fix typos in man page