diff options
3 files changed, 16 insertions, 3 deletions
diff --git a/meta-oe/recipes-extended/smartmontools/files/initd.smartd b/meta-oe/recipes-extended/smartmontools/files/initd.smartd index 29c27e475..54adcb406 100755 --- a/meta-oe/recipes-extended/smartmontools/files/initd.smartd +++ b/meta-oe/recipes-extended/smartmontools/files/initd.smartd | |||
@@ -16,8 +16,8 @@ | |||
16 | # Should-Start: sendmail | 16 | # Should-Start: sendmail |
17 | # Required-Stop: $syslog $remote_fs | 17 | # Required-Stop: $syslog $remote_fs |
18 | # Should-Stop: sendmail | 18 | # Should-Stop: sendmail |
19 | # Default-Start: | 19 | # Default-Start: 2 3 4 5 |
20 | # Default-Stop: 0 1 2 3 4 5 6 | 20 | # Default-Stop: 0 1 6 |
21 | # Short-Description: Monitors disk and tape health via S.M.A.R.T. | 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. | 22 | # Description: Start S.M.A.R.T. disk and tape monitor. |
23 | ### END INIT INFO | 23 | ### END INIT INFO |
@@ -52,6 +52,10 @@ smartd_opts="--pidfile $SMARTDPID $smartd_opts" | |||
52 | 52 | ||
53 | case "$1" in | 53 | case "$1" in |
54 | start) | 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 | ||
55 | echo -n "Starting S.M.A.R.T. daemon: smartd" | 59 | echo -n "Starting S.M.A.R.T. daemon: smartd" |
56 | if start-stop-daemon --start --quiet --pidfile $SMARTDPID \ | 60 | if start-stop-daemon --start --quiet --pidfile $SMARTDPID \ |
57 | --exec $SMARTD_BIN -- $smartd_opts; then | 61 | --exec $SMARTD_BIN -- $smartd_opts; then |
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 index 9b9454c88..b64b96191 100644 --- a/meta-oe/recipes-extended/smartmontools/smartmontools_6.2.bb +++ b/meta-oe/recipes-extended/smartmontools/smartmontools_6.2.bb | |||
@@ -14,6 +14,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" | |||
14 | 14 | ||
15 | SRC_URI = "${SOURCEFORGE_MIRROR}/smartmontools/smartmontools-${PV}.tar.gz \ | 15 | SRC_URI = "${SOURCEFORGE_MIRROR}/smartmontools/smartmontools-${PV}.tar.gz \ |
16 | file://initd.smartd \ | 16 | file://initd.smartd \ |
17 | file://smartmontools.default \ | ||
17 | " | 18 | " |
18 | 19 | ||
19 | PACKAGECONFIG ??= "${@base_contains('DISTRO_FEATURES', 'libcap-ng', 'libcap-ng', '', d)} \ | 20 | PACKAGECONFIG ??= "${@base_contains('DISTRO_FEATURES', 'libcap-ng', 'libcap-ng', '', d)} \ |
@@ -31,9 +32,11 @@ do_install_append () { | |||
31 | #install the init.d/smartd | 32 | #install the init.d/smartd |
32 | install -d ${D}${sysconfdir}/init.d | 33 | install -d ${D}${sysconfdir}/init.d |
33 | install -p -m 0755 ${WORKDIR}/initd.smartd ${D}${sysconfdir}/init.d/smartd | 34 | install -p -m 0755 ${WORKDIR}/initd.smartd ${D}${sysconfdir}/init.d/smartd |
35 | install -d ${D}${sysconfdir}/default | ||
36 | install -p -m 0644 ${WORKDIR}/smartmontools.default ${D}${sysconfdir}/default/smartmontools | ||
34 | } | 37 | } |
35 | 38 | ||
36 | INITSCRIPT_NAME = "smartd" | 39 | INITSCRIPT_NAME = "smartd" |
37 | INITSCRIPT_PARAMS = "start 60 . stop 60 0 1 2 3 4 5 6 ." | 40 | INITSCRIPT_PARAMS = "start 60 2 3 4 5 . stop 60 0 1 6 ." |
38 | 41 | ||
39 | RDEPENDS_${PN} += "mailx" | 42 | RDEPENDS_${PN} += "mailx" |