summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Alexander Kapshuna <kapsh@kap.sh> 2018-12-27 00:45:35 +0300
committerAvatar Heiko Becker <heirecka@exherbo.org> 2019-01-13 18:57:30 +0000
commit748b42665b2643b3cdf85dbcf3210a14aeb98202 (patch)
tree13f47dc0e9d99c3883cf5a8c7899d7591705f3bb
parentab419c86aa3af84f41ccffcbd88aaa2e8fa73f29 (diff)
downloadhardware-748b42665b2643b3cdf85dbcf3210a14aeb98202.tar.gz
hardware-748b42665b2643b3cdf85dbcf3210a14aeb98202.tar.xz
smartmontools: add openrc service for smartd
-rw-r--r--packages/sys-apps/smartmontools/files/openrc/confd/smartd2
-rwxr-xr-xpackages/sys-apps/smartmontools/files/openrc/initd/smartd21
-rw-r--r--packages/sys-apps/smartmontools/smartmontools-6.6.exheres-04
3 files changed, 26 insertions, 1 deletions
diff --git a/packages/sys-apps/smartmontools/files/openrc/confd/smartd b/packages/sys-apps/smartmontools/files/openrc/confd/smartd
new file mode 100644
index 0000000..d354b91
--- /dev/null
+++ b/packages/sys-apps/smartmontools/files/openrc/confd/smartd
@@ -0,0 +1,2 @@
+# See man smartd(8) for all available options
+SMARTD_OPTIONS=""
diff --git a/packages/sys-apps/smartmontools/files/openrc/initd/smartd b/packages/sys-apps/smartmontools/files/openrc/initd/smartd
new file mode 100755
index 0000000..67eadd9
--- /dev/null
+++ b/packages/sys-apps/smartmontools/files/openrc/initd/smartd
@@ -0,0 +1,21 @@
+#!/usr/host/bin/openrc-run
+
+description="SMART Disk Monitoring Daemon"
+command="/usr/host/bin/smartd"
+pidfile="/run/${RC_SVCNAME}.pid"
+command_args="-p ${pidfile} ${SMARTD_OPTIONS}"
+
+extra_started_commands="reload"
+
+depend() {
+ after bootmisc
+ need localmount
+ use logger
+}
+
+reload() {
+ ebegin "Reloading ${RC_SVCNAME}"
+ start-stop-daemon -s HUP -p "${pidfile}"
+ eend $?
+}
+
diff --git a/packages/sys-apps/smartmontools/smartmontools-6.6.exheres-0 b/packages/sys-apps/smartmontools/smartmontools-6.6.exheres-0
index bea25f7..af6f1ca 100644
--- a/packages/sys-apps/smartmontools/smartmontools-6.6.exheres-0
+++ b/packages/sys-apps/smartmontools/smartmontools-6.6.exheres-0
@@ -4,7 +4,8 @@
# Copyright 1999-2008 Gentoo Foundation
require flag-o-matic systemd-service sourceforge [ suffix=tar.gz ] \
- option-renames [ renames=[ 'libcap-ng caps' ] ]
+ option-renames [ renames=[ 'libcap-ng caps' ] ] \
+ openrc-service [ openrc_confd_files=[ "${FILES}/openrc/confd" ] ]
SUMMARY="Utilities for SMART-capable storage devices"
DESCRIPTION="
@@ -59,6 +60,7 @@ src_compile() {
src_install() {
default
+ install_openrc_files
keepdir /var/lib/${PN}
keepdir /etc/smartd_warning.d
}