summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-extended/smartmontools
diff options
context:
space:
mode:
authorTudor Florea <tudor.florea@enea.com>2015-10-08 22:51:41 +0200
committerTudor Florea <tudor.florea@enea.com>2015-10-08 22:51:41 +0200
commit1219bf8a90a7bf8cd3a5363551ef635d51e8fc8e (patch)
treea21a5fc103bb3bd65ecd85ed22be5228fc54e447 /meta-oe/recipes-extended/smartmontools
downloadmeta-openembedded-1219bf8a90a7bf8cd3a5363551ef635d51e8fc8e.tar.gz
initial commit for Enea Linux 5.0 arm
Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'meta-oe/recipes-extended/smartmontools')
-rwxr-xr-xmeta-oe/recipes-extended/smartmontools/files/initd.smartd112
-rw-r--r--meta-oe/recipes-extended/smartmontools/files/smartd.service12
-rw-r--r--meta-oe/recipes-extended/smartmontools/files/smartmontools.default6
-rw-r--r--meta-oe/recipes-extended/smartmontools/smartmontools_6.2.bb54
4 files changed, 184 insertions, 0 deletions
diff --git a/meta-oe/recipes-extended/smartmontools/files/initd.smartd b/meta-oe/recipes-extended/smartmontools/files/initd.smartd
new file mode 100755
index 000000000..54adcb406
--- /dev/null
+++ b/meta-oe/recipes-extended/smartmontools/files/initd.smartd
@@ -0,0 +1,112 @@
1#! /bin/sh
2
3# smartmontools init file for smartd
4# Copyright (C) 2002-8 Bruce Allen <smartmontools-support@lists.sourceforge.net>
5# $Id: smartd.initd.in 3360 2011-06-06 19:25:36Z chrfranke $
6
7# For RedHat and cousins:
8# chkconfig: - 60 60
9# description: Self Monitoring and Reporting Technology (SMART) Daemon
10# processname: smartd
11
12# For SuSE and cousins
13### BEGIN INIT INFO
14# Provides: smartd
15# Required-Start: $syslog $remote_fs
16# Should-Start: sendmail
17# Required-Stop: $syslog $remote_fs
18# Should-Stop: sendmail
19# Default-Start: 2 3 4 5
20# Default-Stop: 0 1 6
21# Short-Description: Monitors disk and tape health via S.M.A.R.T.
22# Description: Start S.M.A.R.T. disk and tape monitor.
23### END INIT INFO
24
25# This program is free software; you can redistribute it and/or modify it
26# under the terms of the GNU General Public License as published by the Free
27# Software Foundation; either version 2, or (at your option) any later
28# version.
29# You should have received a copy of the GNU General Public License (for
30# example COPYING); if not, write to the Free Software Foundation, Inc., 675
31# Mass Ave, Cambridge, MA 02139, USA.
32# This code was originally developed as a Senior Thesis by Michael Cornwell
33# at the Concurrent Systems Laboratory (now part of the Storage Systems
34# Research Center), Jack Baskin School of Engineering, University of
35# California, Santa Cruz. http://ssrc.soe.ucsc.edu/.
36
37# Uncomment the line below to pass options to smartd on startup.
38# Note that distribution specific configuration files like
39# /etc/{default,sysconfig}/smartmontools might override these
40#smartd_opts="--interval=1800"
41
42SMARTD_BIN=/usr/sbin/smartd
43SMARTDPID=/var/run/smartd.pid
44[ -x $SMARTD_BIN ] || exit 0
45RET=0
46
47# source configuration file
48[ -r /etc/default/rcS ] && . /etc/default/rcS
49[ -r /etc/default/smartmontools ] && . /etc/default/smartmontools
50
51smartd_opts="--pidfile $SMARTDPID $smartd_opts"
52
53case "$1" in
54 start)
55 if [ "$start_smartd" != "yes" ]; then
56 [ "$VERBOSE" != "no" ] && echo "Not starting S.M.A.R.T. daemon smartd, disabled via /etc/default/smartmontools"
57 exit 0
58 fi
59 echo -n "Starting S.M.A.R.T. daemon: smartd"
60 if start-stop-daemon --start --quiet --pidfile $SMARTDPID \
61 --exec $SMARTD_BIN -- $smartd_opts; then
62 echo "."
63 else
64 echo " (failed)"
65 RET=1
66 fi
67 ;;
68 stop)
69 echo -n "Stopping S.M.A.R.T. daemon: smartd"
70 start-stop-daemon --stop --quiet --oknodo --pidfile $SMARTDPID
71 echo "."
72 ;;
73 restart)
74 $0 stop
75 $0 start
76 ;;
77 force-reload)
78 $0 reload || $0 restart
79 ;;
80 reload)
81 echo -n "Reload S.M.A.R.T. daemon: smartd"
82 if start-stop-daemon --stop --quiet --signal 1 \
83 --pidfile $SMARTDPID; then
84 echo "."
85 else
86 echo " (failed)"
87 RET=1
88 fi
89 ;;
90 report)
91 echo -n "Checking SMART devices now"
92 if start-stop-daemon --stop --quiet --signal 10 \
93 --pidfile $SMARTDPID; then
94 echo "."
95 else
96 echo " (failed)"
97 RET=1
98 fi
99 ;;
100 status)
101 if pidof $SMARTD_BIN >/dev/null; then
102 echo "$SMARTD_BIN is running."
103 else
104 echo "$SMARTD_BIN is not running."
105 RET=1
106 fi
107 ;;
108 *)
109 echo "Usage: $0 {start|stop|restart|force-reload|reload|report|status}"
110 exit 1
111esac
112exit $RET
diff --git a/meta-oe/recipes-extended/smartmontools/files/smartd.service b/meta-oe/recipes-extended/smartmontools/files/smartd.service
new file mode 100644
index 000000000..f3db946c8
--- /dev/null
+++ b/meta-oe/recipes-extended/smartmontools/files/smartd.service
@@ -0,0 +1,12 @@
1[Unit]
2Description=Self Monitoring and Reporting Technology (SMART) Daemon
3After=syslog.target
4
5[Service]
6EnvironmentFile=-@SYSCONFDIR@/smartmontools
7ExecStart=@SBINDIR@/smartd -n $smart_opts
8ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID
9StandardOutput=syslog
10
11[Install]
12WantedBy=multi-user.target
diff --git a/meta-oe/recipes-extended/smartmontools/files/smartmontools.default b/meta-oe/recipes-extended/smartmontools/files/smartmontools.default
new file mode 100644
index 000000000..602e00beb
--- /dev/null
+++ b/meta-oe/recipes-extended/smartmontools/files/smartmontools.default
@@ -0,0 +1,6 @@
1# uncomment to start smartd on system startup for SysV init script
2# For systemd service file, use `systemctl enable smartd'.
3#start_smartd=yes
4
5# uncomment to pass additional options to smartd on startup
6#smartd_opts="--interval=1800"
diff --git a/meta-oe/recipes-extended/smartmontools/smartmontools_6.2.bb b/meta-oe/recipes-extended/smartmontools/smartmontools_6.2.bb
new file mode 100644
index 000000000..fd7b1b8c5
--- /dev/null
+++ b/meta-oe/recipes-extended/smartmontools/smartmontools_6.2.bb
@@ -0,0 +1,54 @@
1SUMMARY = "Control and monitor storage systems using S.M.A.R.T"
2DESCRIPTION = \
3"The smartmontools package contains two utility programs (smartctl \
4and smartd) to control and monitor storage systems using the Self-\
5Monitoring, Analysis and Reporting Technology System (SMART) built \
6into most modern ATA and SCSI hard disks. In many cases, these \
7utilities will provide advanced warning of disk degradation and failure."
8
9HOMEPAGE = "http://smartmontools.sourceforge.net/"
10SECTION = "console/utils"
11
12LICENSE = "GPLv2"
13LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
14
15SRC_URI = "${SOURCEFORGE_MIRROR}/smartmontools/smartmontools-${PV}.tar.gz \
16 file://initd.smartd \
17 file://smartmontools.default \
18 file://smartd.service \
19 "
20
21PACKAGECONFIG ??= "${@base_contains('DISTRO_FEATURES', 'libcap-ng', 'libcap-ng', '', d)} \
22 ${@base_contains('DISTRO_FEATURES', 'selinux', 'selinux', '', d)} \
23 "
24PACKAGECONFIG[libcap-ng] = "--with-libcap-ng=yes,--with-libcap-ng=no,libcap-ng"
25PACKAGECONFIG[selinux] = "--with-selinux=yes,--with-selinux=no,libselinux"
26
27SRC_URI[md5sum] = "d44f84081a12cef79cd17f78044351fc"
28SRC_URI[sha256sum] = "486f660579bb0fb4f6b927ded7531cb1f99685c666397377761c5b04dd96065b"
29
30inherit autotools update-rc.d systemd
31
32SYSTEMD_SERVICE_${PN} = "smartd.service"
33SYSTEMD_AUTO_ENABLE = "disable"
34
35do_install_append () {
36 #install the init.d/smartd
37 install -d ${D}${sysconfdir}/init.d
38 install -p -m 0755 ${WORKDIR}/initd.smartd ${D}${sysconfdir}/init.d/smartd
39 install -d ${D}${sysconfdir}/default
40 install -p -m 0644 ${WORKDIR}/smartmontools.default ${D}${sysconfdir}/default/smartmontools
41
42 #install systemd service file
43 install -d ${D}${systemd_unitdir}/system
44 install -m 0644 ${WORKDIR}/smartd.service ${D}${systemd_unitdir}/system
45 sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
46 -e 's,@SYSCONFDIR@,${sysconfdir},g' \
47 -e 's,@SBINDIR@,${sbindir},g' \
48 ${D}${systemd_unitdir}/system/smartd.service
49}
50
51INITSCRIPT_NAME = "smartd"
52INITSCRIPT_PARAMS = "start 60 2 3 4 5 . stop 60 0 1 6 ."
53
54RDEPENDS_${PN} += "mailx"