app-admin/rasdaemon: fix multiple issues with initscripts
authorGeorgy Yakovlev <gyakovlev@gentoo.org>
Fri, 14 Dec 2018 08:39:59 +0000 (00:39 -0800)
committerMatthew Thode <prometheanfire@gentoo.org>
Fri, 14 Dec 2018 09:32:57 +0000 (03:32 -0600)
Brush up initscripts so they properly start, stop, log
and don't clobber output.

Package-Manager: Portage-2.3.52, Repoman-2.3.12
Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>
Signed-off-by: Matthew Thode <prometheanfire@gentoo.org>
app-admin/rasdaemon/files/ras-mc-ctl.openrc-r1 [new file with mode: 0644]
app-admin/rasdaemon/files/rasdaemon.openrc-r1 [new file with mode: 0644]
app-admin/rasdaemon/rasdaemon-0.6.2-r3.ebuild [moved from app-admin/rasdaemon/rasdaemon-0.6.2-r2.ebuild with 90% similarity]

diff --git a/app-admin/rasdaemon/files/ras-mc-ctl.openrc-r1 b/app-admin/rasdaemon/files/ras-mc-ctl.openrc-r1
new file mode 100644 (file)
index 0000000..316b28a
--- /dev/null
@@ -0,0 +1,23 @@
+#!/sbin/openrc-run
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+description="Loads Motherboard DIMM labels into EDAC driver"
+
+depend() {
+       keyword -stop
+       need sysfs
+}
+
+command="/usr/sbin/ras-mc-ctl"
+command_args="--register-labels"
+
+start() {
+       ebegin "Loading Motherboard DIMM labels into EDAC driver"
+       "${command}" "${command_args}"
+       eend $?
+}
+
+stop() {
+       :
+}
diff --git a/app-admin/rasdaemon/files/rasdaemon.openrc-r1 b/app-admin/rasdaemon/files/rasdaemon.openrc-r1
new file mode 100644 (file)
index 0000000..6532826
--- /dev/null
@@ -0,0 +1,24 @@
+#!/sbin/openrc-run
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+description="Starts Reliablity, Availability and Serviceability (RAS) service"
+
+depend() {
+       need localmount
+       use logger
+}
+
+command="/usr/sbin/rasdaemon"
+command_args="--foreground --record"
+command_background=true
+pidfile=/run/${RC_SVCNAME}.pid
+
+
+start_post() {
+       "${command}" --enable >/dev/null 2>&1
+}
+
+stop_post() {
+       "${command}" --disable >/dev/null 2>&1
+}
similarity index 90%
rename from app-admin/rasdaemon/rasdaemon-0.6.2-r2.ebuild
rename to app-admin/rasdaemon/rasdaemon-0.6.2-r3.ebuild
index 0e27e9fe31e3bde53f2542c158c0aef8368b34dc..fca06e7b0f0428a1d81239b0589db45a7a8c18e8 100644 (file)
@@ -52,6 +52,6 @@ src_install() {
 
        systemd_dounit misc/*.service
 
-       newinitd "${FILESDIR}/rasdaemon.openrc" rasdaemon
-       newinitd "${FILESDIR}/ras-mc-ctl.openrc" ras-mc-ctl
+       newinitd "${FILESDIR}/rasdaemon.openrc-r1" rasdaemon
+       newinitd "${FILESDIR}/ras-mc-ctl.openrc-r1" ras-mc-ctl
 }