summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Schmaus <flow@gentoo.org>2024-07-24 13:59:40 +0200
committerFlorian Schmaus <flow@gentoo.org>2024-07-25 09:20:39 +0200
commite765c8b50800a67f21a7b5e65a13a6a6971b5b8b (patch)
tree1f16aef7ed3c9de3a5f8927f1373b5158ed4364c /app-misc/openhab-bin
parentapp-arch/unzip-6.0_p27-r1: fix building on Solaris (diff)
downloadgentoo-e765c8b50800a67f21a7b5e65a13a6a6971b5b8b.tar.gz
gentoo-e765c8b50800a67f21a7b5e65a13a6a6971b5b8b.tar.bz2
gentoo-e765c8b50800a67f21a7b5e65a13a6a6971b5b8b.zip
app-misc/openhab-bin: add support for OpenRC
Thanks to Xavier Miller for the initial patches. Closes: https://bugs.gentoo.org/936265 Signed-off-by: Florian Schmaus <flow@gentoo.org>
Diffstat (limited to 'app-misc/openhab-bin')
-rw-r--r--app-misc/openhab-bin/files/openhab.initd18
-rw-r--r--app-misc/openhab-bin/openhab-bin-4.2.0-r1.ebuild (renamed from app-misc/openhab-bin/openhab-bin-4.2.0.ebuild)11
2 files changed, 29 insertions, 0 deletions
diff --git a/app-misc/openhab-bin/files/openhab.initd b/app-misc/openhab-bin/files/openhab.initd
new file mode 100644
index 000000000000..a5899b24994f
--- /dev/null
+++ b/app-misc/openhab-bin/files/openhab.initd
@@ -0,0 +1,18 @@
+#!/sbin/openrc-run
+
+pidfile=/run/${SVCNAME}.pid
+
+command_user="openhab:openhab"
+command="/usr/bin/openhab"
+command_args="daemon"
+command_background=true
+
+depend() {
+ need net
+}
+
+stop() {
+ ebegin "Stopping ${RC_SVCNAME}"
+ ${command} stop
+ eend $?
+}
diff --git a/app-misc/openhab-bin/openhab-bin-4.2.0.ebuild b/app-misc/openhab-bin/openhab-bin-4.2.0-r1.ebuild
index 9b1c384fe722..6625624aba64 100644
--- a/app-misc/openhab-bin/openhab-bin-4.2.0.ebuild
+++ b/app-misc/openhab-bin/openhab-bin-4.2.0-r1.ebuild
@@ -96,6 +96,8 @@ export JAVA_HOME
exec /usr/share/openhab/runtime/bin/karaf "\$@"
EOF
newbin "${DISTDIR}"/openhab-cli-2024-01-14 openhab-cli
+
+ newinitd "${FILESDIR}"/openhab.initd openhab
}
pkg_postinst() {
@@ -120,5 +122,14 @@ pkg_postinst() {
if [[ -v openhab_service_active ]]; then
edob systemctl start openhab
fi
+ elif [[ -d /run/openrc ]]; then
+ einfo "Follow these steps to complete the update of OpenHAB:"
+ einfo
+ einfo "1. Stop the OpenHAB's service"
+ einfo "$ rc-service openhab stop"
+ einfo "2. Clean OpenHAB's cache"
+ einfo "$ openahb-cli clean-cache"
+ einfo "3. Restart OpenHAB's service"
+ einfo "$ rc-service openhab start"
fi
}