From: Bill D. <va...@ch...> - 2011-06-16 16:55:22
|
<cfrees <at> imapmail.org> writes: > > On Wed 11th Aug, 2010 at 16:44, Scott Haneda seems to have written: > > My issue is with logging... Sorry I don't have an answer yet, but I'll let you know what I've found... I also use the smartd from macports smartmontools-port, and wanted smartd to routinely write to some log file. I'll follow-up with some testing results. I've got something like debian's smart-notify working for windows, and am trying to do so for mac os x as well. The other major shortcoming in darwin-osx seems to be that it does not support smartctrl --offlineauto=on flag per http://sourceforge.net/mailarchive/message.php?msg_id=26943608 Even with newest 5.41: $ ./smartctl --offlineauto=on disk0 smartctl 5.41 2011-06-09 r3365 [x86_64-apple-darwin10.7.0] (local build) Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net === START OF ENABLE/DISABLE COMMANDS SECTION === Error SMART Enable Automatic Offline failed: Operation not supported Smartctl: SMART Enable Automatic Offline Failed. Yet I can boot the very same intel mac from a live linux cd and this works fine: smartctrl --offlineauto=on /dev/sda And after rebooting back to mac-os-x it now shows "Auto offline data collection: enabled" so the setting sticks. Go figure: darwin/osx is an odd bird. Also, about getting smartd to automatically run after each reboot... I recall having to do some tweaks so that macports launched smartd correctly via launchd. You don't have to use the launchctl long-winded command, but, as port-install now mentions, you can set it up to run as a daemon by just typing: sudo /opt/local/bin/port load smartmontools They only remind you once during the install script: ########################################################### # A startup item has been generated that will aid in # starting smartmontools with launchd. It is disabled # by default. Execute the following command to start it, # and to cause it to launch at startup: # # sudo port load smartmontools ########################################################### Above command really does set up smartd as the startup item on all 10.5 and 10.6 boxes I've tried but see notes below. BTW I think the port load command works for other ports like mysql, apache, etc. Somewhat equivalent to this in linux: chkconfig smartd on, /etc/init.d/smartd start Originally smartd kept crashing, so ran it with -d and found I had to create path or fix permissions where darwin-ports smartd wants to write log-like files namely: /opt/local/var/lib/smartmontools Works on both 10.6-intel and 10.5-ppc boxes I've tested. Now if I can figure out a way to periodically log to a plain flat text file. I don't trust the new mac syslog database system: if there's one place you want simplicity, it is the logging system! And don't get me started on those #$%#+@ plists. Entire transcript below... $ sudo /opt/local/bin/port selfupdate ---> Updating the ports tree ---> Updating MacPorts base sources using rsync MacPorts base version 1.9.2 installed, MacPorts base version 1.9.2 downloaded. ---> MacPorts base is already the latest version The ports tree has been updated. To upgrade your installed ports, you should run port upgrade outdated $ sudo /opt/local/bin/port -v upgrade outdated Error: No ports matched the given expression $ sudo /opt/local/bin/port install smartmontools ---> Fetching smartmontools ---> Attempting to fetch smartmontools-5.40.tar.gz from http://voxel.dl.sourceforge.net/smartmontools ---> Verifying checksum(s) for smartmontools ---> Extracting smartmontools ---> Applying patches to smartmontools ---> Configuring smartmontools ---> Building smartmontools ---> Staging smartmontools into destroot ---> Creating launchd control script ########################################################### # A startup item has been generated that will aid in # starting smartmontools with launchd. It is disabled # by default. Execute the following command to start it, # and to cause it to launch at startup: # # sudo port load smartmontools ########################################################### ---> Installing smartmontools @5.40_3 ---> Activating smartmontools @5.40_3 ---> Cleaning smartmontools $ sudo /opt/local/bin/port load smartmontools $ ps -ef | grep -i smart 501 143 118 0 0:01.18 ?? 0:02.40 /Applications/SMARTReporter/SMARTReporter.app/Contents/MacOS/SMARTReporter -psn_0_45067 0 5840 1 0 0:00.01 ?? 0:00.01 /opt/local/bin/daemondo --label=smartd --start-cmd /opt/local/sbin/smartd -p /opt/local/var/run/smartd.pid ; --pid=fileauto --pidfile /opt/local/var/run/smartd.pid 0 5843 1 0 0:00.01 ?? 0:00.01 /opt/local/sbin/smartd -p /opt/local/var/run/smartd.pid 501 7631 3687 0 0:00.01 ttys001 0:00.01 grep -i smart By the way, the fellow that wrote SMARTReporter said it's once-per-hour querry should not interfere with any long self-tests since in effect it only does "smartctl -l selftest disk0" which does not interrupt any tests. That is the way gsmartcontrol gives a progress bar of the self-test. The fink gsmartcontrol can be run on mac os x, at least I got it to run in 10.5. In an X11 xterm window type sudo /sw/bin/gsmartcontrol |