[smartmontools/f15] fix path to notify script (#675778)

Michal Hlavinka mhlavink at fedoraproject.org
Mon May 16 13:49:40 UTC 2011


commit d1af8cdf187cddd22afcba5d171a4c10396c3b18
Author: Michal Hlavinka <mhlavink at redhat.com>
Date:   Mon May 16 15:49:28 2011 +0200

    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 907ad3a..6570b3e 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:	8%{?dist}
+Release:	9%{?dist}
 Epoch:		1
 Group:		System Environment/Base
 License:	GPLv2+
@@ -114,6 +114,9 @@ fi
 %{_datadir}/%{name}
 
 %changelog
+* Mon May 16 2011 Michal Hlavinka <mhlavink at redhat.com> - 1:5.40-9
+- fix path to notify script (#675778)
+
 * Fri Mar 04 2011 Michal Hlavinka <mhlavink at redhat.com> - 1:5.40-8
 - don't call chkconfig add, we use systemd now
  


More information about the scm-commits mailing list