From: Jens S. <sch...@sc...> - 2004-05-01 09:45:04
|
Bruce, I could not find any info in the man page how and where report bugs to. The sourceforge site also doesn't appear to have a bug database, or I had difficulties spotting it, so here goes my report. There are two problems with the smartd.sh.sample script as shipped for FreeBSD, $Id: smartd.initd.in,v 1.21 2004/03/05 14:55:14 ballen4705 Exp $ - /usr/local/sbin is not in the PATH when the system startup scripts are run, so we need to use the full path name /usr/local/sbin/smartd. - The echo -n "smartd " should have the space not appended, but prepended. I think this is true not only for FreeBSD, but other OSs as well. - The script has a lot of useless whitespace at end-of-lines. If you happen to use vim6, put match Todo /\s\+$/ in your .vimrc to make it jump right in your face :-) Emacs has surely something similar. Regards, Jens -- Jens Schweikhardt http://www.schweikhardt.net/ SIGSIG -- signature too long (core dumped) --- smartd.sh.sample Sat Apr 24 01:48:29 2004 +++ smartd.sh Sat May 1 10:32:40 2004 @@ -7,7 +7,7 @@ # For RedHat and cousins: # chkconfig: 2345 40 40 # description: Self Monitoring and Reporting Technology (SMART) Daemon -# processname: smartd +# processname: smartd # # For SuSE and cousins ### BEGIN INIT INFO @@ -26,7 +26,7 @@ # under the terms of the GNU General Public License as published by the Free # Software Foundation; either version 2, or (at your option) any later # version. -# +# # You should have received a copy of the GNU General Public License (for # example COPYING); if not, write to the Free Software Foundation, Inc., 675 # Mass Ave, Cambridge, MA 02139, USA. @@ -46,14 +46,14 @@ # Red Hat or Yellow Dog or Mandrake if [ -f /etc/redhat-release -o -f /etc/yellowdog-release -o -f /etc/mandrake-release ] ; then - + # Source function library . /etc/rc.d/init.d/functions - + RETVAL=0 - + prog=smartd - + case "$1" in start) echo -n $"Starting $prog: " @@ -90,12 +90,12 @@ echo $"Usage: $0 {start|stop|reload|report|restart|status}" RETVAL=1 esac - + exit $RETVAL # Slackware elif [ -f /etc/slackware-version ] ; then - + case "$1" in start) echo -n "Starting smartd: " @@ -116,12 +116,12 @@ echo "Usage: smartd {start|stop|restart}" exit 1 esac - + exit 0 - + # SuSE elif [ -f /etc/SuSE-release ] ; then - + SMARTD_BIN=/usr/sbin/smartd test -x $SMARTD_BIN || exit 5 @@ -137,10 +137,10 @@ # rc_reset clear local rc status (overall remains) # rc_exit exit appropriate to overall rc status . /etc/rc.status - + # First reset status of this service rc_reset - + # Return values acc. to LSB for all commands but status: # 0 - success # 1 - misc error @@ -159,18 +159,18 @@ echo -n "Starting smartd" ## Start daemon with startproc(8). If this fails ## the echo return value is set appropriate. - + # startproc should return 0, even if service is # already running to match LSB spec. startproc $SMARTD_BIN - + # Remember status and be verbose rc_status -v ;; stop) echo -n "Shutting down smartd" killproc -TERM $SMARTD_BIN - + # Remember status and be verbose rc_status -v ;; @@ -188,13 +188,13 @@ echo -n "Checking for service smartd: " ## Check status with checkproc(8), if process is running ## checkproc will return with exit status 0. - + # Status has a slightly different for the status command: # 0 - service running # 1 - service dead, but /var/run/ pid file exists # 2 - service dead, but /var/lock/ lock file exists # 3 - service not running - + # NOTE: checkproc returns LSB compliant status values. checkproc $SMARTD_BIN rc_status -v @@ -211,9 +211,9 @@ exit 1 ;; esac - + rc_exit - + # Add other linux distributions HERE, using elif... elif [ -f /etc/environment.corel ] ; then report_unsupported "Corel" @@ -229,12 +229,12 @@ [ -r /etc/default/smartmontools ] && . /etc/default/smartmontools smartd_opts="--pidfile $SMARTDPID $smartd_opts" - + case "$1" in start) echo -n "Starting S.M.A.R.T. daemon: smartd" if start-stop-daemon --start --quiet --pidfile $SMARTDPID \ - --exec $SMARTD -- $smartd_opts; then + --exec $SMARTD -- $smartd_opts; then echo "." else echo " (failed)" @@ -262,15 +262,15 @@ elif uname -a | grep FreeBSD > /dev/null 2>&1 ; then PID_FILE=/var/run/smartd.pid - + case "$1" in start) - smartd -p $PID_FILE - echo -n "smartd " + /usr/local/sbin/smartd -p $PID_FILE + echo -n " smartd" ;; stop) kill `cat $PID_FILE` - echo -n "smartd " + echo -n " smartd" ;; restart) $0 stop @@ -281,12 +281,12 @@ echo "Usage: smartd {start|stop|restart}" exit 1 esac - + exit 0 elif uname -a | grep SunOS > /dev/null 2>&1 ; then - + PID_FILE=/var/run/smartd.pid - + case "$1" in start) smartd -p $PID_FILE @@ -305,14 +305,14 @@ echo "Usage: smartd {start|stop|restart}" exit 1 esac - + exit 0 else report_unsupported "Unknown" fi # One should NEVER arrive here, except for a badly written case above, -# that fails to exit. +# that fails to exit. echo "SOMETHING IS WRONG WITH THE SMARTD STARTUP SCRIPT" echo "PLEASE CONTACT sma...@li..." exit 1 |