Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 Aug 2009 18:15:26 +0200
From:      Marcin Wisnicki <mwisnicki+freebsd@gmail.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/138108: [NEW PORT] sysutils/smartmontools-snapshot: S.M.A.R.T. disk monitoring tools (SVN snapshot)
Message-ID:  <4a916b20.06e2660a.557d.ffffe8fb@mx.google.com>
Resent-Message-ID: <200908231620.n7NGK120077770@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         138108
>Category:       ports
>Synopsis:       [NEW PORT] sysutils/smartmontools-snapshot: S.M.A.R.T. disk monitoring tools (SVN snapshot)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Aug 23 16:20:01 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     Marcin Wisnicki
>Release:        FreeBSD 7.2-STABLE i386
>Organization:
>Environment:
System: FreeBSD ghost.pnet.one.pl 7.2-STABLE FreeBSD 7.2-STABLE #2: Sun Aug  2 16:43:15 CEST
>Description:
Add SVN snapshot version of smartmontools.

Compared to version 5.38 this SVN snapshot brings more USB hardware support:
 http://sourceforge.net/apps/trac/smartmontools/wiki/Supported_USB-Devices
as well as other improvements.

I need this for my new USB enclosure.

Since this new port is mostly a copy of sysutils/smartmontools I'm not sure
whether I should submit diff or shar. If diff is preferred please tell me.

Generated with FreeBSD Port Tools 0.77
>How-To-Repeat:
>Fix:

--- smartmontools-5.38.r2874.shar begins here ---
# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	smartmontools-snapshot
#	smartmontools-snapshot/files
#	smartmontools-snapshot/files/smart.in
#	smartmontools-snapshot/files/pkg-message.in
#	smartmontools-snapshot/files/smartd.in
#	smartmontools-snapshot/files/patch-os__freebsd.cpp
#	smartmontools-snapshot/Makefile
#	smartmontools-snapshot/distinfo
#	smartmontools-snapshot/pkg-descr
#	smartmontools-snapshot/pkg-plist
#
echo c - smartmontools-snapshot
mkdir -p smartmontools-snapshot > /dev/null 2>&1
echo c - smartmontools-snapshot/files
mkdir -p smartmontools-snapshot/files > /dev/null 2>&1
echo x - smartmontools-snapshot/files/smart.in
sed 's/^X//' >smartmontools-snapshot/files/smart.in << '40b9378b90136e35a040fa144a5d3a67'
X#!/bin/sh
X# This script is in the public domain.  Original author: Garrett Wollman
X#
X# $FreeBSD: ports/sysutils/smartmontools/files/smart.in,v 1.5 2009/06/03 18:12:30 wxs Exp $
X#
X
Xif [ -r /etc/defaults/periodic.conf ]; then
X    . /etc/defaults/periodic.conf
X    source_periodic_confs
Xfi
X
Xsmartctl=%%PREFIX%%/sbin/smartctl
X: ${daily_status_smartctl_flags="-H"}
X: ${daily_status_smartctl_extra_status_flags="-a"}
X
Xcase "${daily_status_smart_devices}" in
X	# XXX AUTO mode selects only regular ad/da disks 
X	[Aa][Uu][Tt][Oo])
X		daily_status_smart_devices=`sysctl -n kern.disks`
X		;;
X	*)	;;
Xesac
X
Xif [ -z "${daily_status_smart_devices}" ]; then
X	: ${daily_status_smart_enable="NO"}
Xelse
X	: ${daily_status_smart_enable="YES"}
Xfi
X
Xtrim_junk="tail -n +4"
X
Xtmpfile="$(mktemp /var/run/daily.XXXXXXXX)"
Xtrap "rm -f ${tmpfile}" 0 1 3 15
X
Xrc=0
Xcase "${daily_status_smart_enable}" in
X	[Yy][Ee][Ss])
X		cd /dev
X		for device in ${daily_status_smart_devices}; do
X			if [ -e ${device} ]; then
X				echo 
X				echo "Checking health of ${device}:"
X				echo
X				${smartctl} ${daily_status_smartctl_flags} ${device} > "${tmpfile}"
X				status=$?
X				if [ $((status & 3)) -ne 0 ]; then
X					rc=2
X					${trim_junk} "${tmpfile}"
X				elif [ $status -ne 0 ]; then
X					rc=1
X					${smartctl} ${daily_status_smartctl_extra_status_flags} ${device} | ${trim_junk}
X				else
X					${trim_junk} "${tmpfile}"
X				fi
X			fi
X		done
X		;;
Xesac
X
Xexit "$rc"
40b9378b90136e35a040fa144a5d3a67
echo x - smartmontools-snapshot/files/pkg-message.in
sed 's/^X//' >smartmontools-snapshot/files/pkg-message.in << '8401a9a14479f97583ea60d9a1c1368c'
Xsmartmontools has been installed
X
XTo check the status of drives, use the following:
X
X	%%PREFIX%%/sbin/smartctl -a /dev/ad0		for first ATA drive
X	%%PREFIX%%/sbin/smartctl -a /dev/da0		for first SCSI drive
X
XTo include drive health information in your daily status reports,
Xadd a line like the following to /etc/periodic.conf:
X	daily_status_smart_devices="/dev/ad0 /dev/da0"
Xsubstituting the appropriate device names for your SMART-capable disks.
X
XTo enable drive monitoring, you can use %%PREFIX%%/sbin/smartd.
XA sample configuration file has been installed as 
X%%PREFIX%%/etc/smartd.conf.sample
XCopy this file to %%PREFIX%%/etc/smartd.conf and edit appropriately
X
XTo have smartd start at boot
X	echo 'smartd_enable="YES"' >> /etc/rc.conf
8401a9a14479f97583ea60d9a1c1368c
echo x - smartmontools-snapshot/files/smartd.in
sed 's/^X//' >smartmontools-snapshot/files/smartd.in << 'f77c8a2b34122c5a30c0d0dc4e9ec434'
X#!/bin/sh
X# $FreeBSD: ports/sysutils/smartmontools/files/smartd.in,v 1.1 2006/05/11 17:02:59 garga Exp $
X
X# PROVIDE: smartd
X# REQUIRE: DAEMON
X# BEFORE: LOGIN
X# KEYWORD: shutdown
X
X# Define these smartd_* variables in one of these files:
X#	/etc/rc.conf
X#	/etc/rc.conf.local
X#	/etc/rc.conf.d/smartd
X#
X# DO NOT CHANGE THESE DEFAULT VALUES HERE
X#
Xsmartd_enable="${smartd_enable-NO}"
Xsmartd_pidfile="/var/run/smartd.pid"
X
X. %%RC_SUBR%%
X
Xname="smartd"
Xrcvar=`set_rcvar`
Xcommand="%%PREFIX%%/sbin/smartd"
X
Xload_rc_config $name
X
X: ${smartd_config="%%PREFIX%%/etc/smartd.conf"}
X: ${smartd_flags="-c ${smartd_config}"}
X
Xpidfile="${smartd_pidfile}"
Xrequired_files="${smartd_config}"
X
Xcase "${smartd_flags}" in
X*-p\ *)
X	echo "ERROR: \$smartd_flags includes -p option." \
X		"Please use \$smartd_pidfile instead."
X	exit 1
X	;;
X*)
X	smartd_flags="-p ${pidfile} ${smartd_flags}"
X	;;
Xesac
X
Xrun_rc_command "$1"
f77c8a2b34122c5a30c0d0dc4e9ec434
echo x - smartmontools-snapshot/files/patch-os__freebsd.cpp
sed 's/^X//' >smartmontools-snapshot/files/patch-os__freebsd.cpp << '1d07a62d879ce247aa8eb8ecd0bf6a3a'
X--- os_freebsd.cpp.orig	2008-03-04 23:09:47.000000000 +0100
X+++ os_freebsd.cpp	2008-03-14 13:52:37.000000000 +0100
X@@ -525,7 +524,7 @@
X     return -1;
X   }
X
X-  if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) {
X+  if (((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) && ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_SCSI_STATUS_ERROR)) {
X  #if __FreeBSD_version > 500000
X     cam_error_print(cam_dev,ccb,CAM_ESF_ALL,CAM_EPF_ALL,stderr);
X  #endif
1d07a62d879ce247aa8eb8ecd0bf6a3a
echo x - smartmontools-snapshot/Makefile
sed 's/^X//' >smartmontools-snapshot/Makefile << 'a22c7d98792454d3c29e725821147a80'
X# New ports collection makefile for:   smartmontools
X# Date created:        12 October 2003
X# Whom:                Eduard Martinescu
X#
X# $FreeBSD: ports/sysutils/smartmontools/Makefile,v 1.40 2009/06/03 18:12:29 wxs Exp $
X#
X
XPORTNAME=	smartmontools
XPORTVERSION=	5.38.r${SVNREVISION}
XCATEGORIES=	sysutils
XMASTER_SITES=	http://wisnia21.freeshell.org/f/ports/distfiles/
X
XMAINTAINER=	mwisnicki+freebsd@gmail.com
XCOMMENT=	S.M.A.R.T. disk monitoring tools (SVN snapshot)
X
XSVNREVISION=	2874
X
XLATEST_LINK=	smartmontools-snapshot
XCONFLICTS=	smartmontools-[0-9].[0-9][0-9]
X
XUSE_AUTOTOOLS=	aclocal:110 autoheader:262 automake:110 autoconf:262
XUSE_BZIP2=	yes
XGNU_CONFIGURE=	yes
XAUTOMAKE_ARGS=	--add-missing --copy --foreign
XCONFIGURE_ARGS=	--with-docdir=${DOCSDIR} --enable-sample --with-initscriptdir=no
X
XSUB_FILES=	pkg-message smart
XUSE_RC_SUBR=	smartd
X
XMAN5=		smartd.conf.5
XMAN8=		smartd.8 smartctl.8
X
XCFLAGS:=	${CFLAGS:S/-O2/-O/}
X
Xpost-install:
X	${MKDIR} ${PREFIX}/etc/periodic/daily
X	${INSTALL_SCRIPT} ${WRKDIR}/smart ${PREFIX}/etc/periodic/daily/smart
X	@${CAT} ${PKGMESSAGE}
X
Xx-maintainer-make-snapshot:
X	svn export -r${SVNREVISION} \
X		https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk/smartmontools \
X		${DISTNAME}
X	${TAR} -cjvf ${DISTNAME}.tar.bz2 ${DISTNAME}
X	${RM} -rf ${DISTNAME}
X
X.include <bsd.port.mk>
a22c7d98792454d3c29e725821147a80
echo x - smartmontools-snapshot/distinfo
sed 's/^X//' >smartmontools-snapshot/distinfo << '3b26d3302e800d753c8655c8aef5e0f3'
XMD5 (smartmontools-5.38.r2874.tar.bz2) = d2cadaaa1a8390c38372f5c4f5972219
XSHA256 (smartmontools-5.38.r2874.tar.bz2) = 96c1f34daddedf6575caa6bfe4621023f8a861b248b1b3f87a5b79e9e00d0875
XSIZE (smartmontools-5.38.r2874.tar.bz2) = 477163
3b26d3302e800d753c8655c8aef5e0f3
echo x - smartmontools-snapshot/pkg-descr
sed 's/^X//' >smartmontools-snapshot/pkg-descr << 'a0b6d65d683c2edeeb1ee58c94a06e33'
XThe smartmontools package contains two utility programs (smartctl and smartd)
Xto control and monitor storage systems using the Self-Monitoring, Analysis
Xand Reporting Technology System (S.M.A.R.T.) built into most modern ATA and
XSCSI hard disks.  It is derived from the smartsuite package, and includes
Xsupport for ATA/ATAPI-5 disks.
X
XCompared to version 5.38 this SVN snapshot brings more USB hardware support:
X http://sourceforge.net/apps/trac/smartmontools/wiki/Supported_USB-Devices
Xas well as other improvements.
X
XWWW: http://smartmontools.sourceforge.net
a0b6d65d683c2edeeb1ee58c94a06e33
echo x - smartmontools-snapshot/pkg-plist
sed 's/^X//' >smartmontools-snapshot/pkg-plist << '544be5c2c8d46a17206d2067da20c304'
X@comment $FreeBSD: ports/sysutils/smartmontools/pkg-plist,v 1.5 2008/12/19 13:14:28 pav Exp $
X@unexec /bin/echo "===>" Stopping smartd ...
X@unexec /usr/bin/killall smartd 2>/dev/null || true
Xetc/periodic/daily/smart
Xetc/smartd.conf.sample
Xsbin/smartctl
Xsbin/smartd
X%%DOCSDIR%%/AUTHORS
X%%DOCSDIR%%/CHANGELOG
X%%DOCSDIR%%/COPYING
X%%DOCSDIR%%/INSTALL
X%%DOCSDIR%%/NEWS
X%%DOCSDIR%%/README
X%%DOCSDIR%%/TODO
X%%DOCSDIR%%/WARNINGS
X%%DOCSDIR%%/examplescripts/Example1
X%%DOCSDIR%%/examplescripts/Example2
X%%DOCSDIR%%/examplescripts/Example3
X%%DOCSDIR%%/examplescripts/Example4
X%%DOCSDIR%%/examplescripts/README
X%%DOCSDIR%%/smartd.conf
X@dirrm %%DOCSDIR%%/examplescripts
X@dirrm %%DOCSDIR%%
X@dirrmtry etc/periodic/daily
X@dirrmtry etc/periodic
544be5c2c8d46a17206d2067da20c304
exit
--- smartmontools-5.38.r2874.shar ends here ---

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4a916b20.06e2660a.557d.ffffe8fb>