From 4397e142db44d2fea7035a96cd5178eedbdbccc2 Mon Sep 17 00:00:00 2001 From: Conrad Kostecki Date: Sun, 14 Jan 2024 00:36:41 +0100 Subject: [PATCH 1/2] Update Gentoo initd/confd files Signed-off-by: Conrad Kostecki --- contrib/gentoo/conf.d/ebusd | 6 +++--- contrib/gentoo/init.d/ebusd | 19 +++++++++++-------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/contrib/gentoo/conf.d/ebusd b/contrib/gentoo/conf.d/ebusd index 0d1b7287..2abae6be 100644 --- a/contrib/gentoo/conf.d/ebusd +++ b/contrib/gentoo/conf.d/ebusd @@ -1,5 +1,5 @@ -# /etc/conf.d/ebusd: -# config file for ebusd service. +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 -# Options to pass to ebusd (run "ebusd -?" for more info): +# Options to pass to ebusd (run "ebusd --help" for more info) EBUSD_OPTS="--scanconfig" diff --git a/contrib/gentoo/init.d/ebusd b/contrib/gentoo/init.d/ebusd index 9735db35..24582d79 100755 --- a/contrib/gentoo/init.d/ebusd +++ b/contrib/gentoo/init.d/ebusd @@ -1,14 +1,17 @@ -#!/sbin/runscript -# Copyright 1999-2013 Gentoo Foundation +#!/sbin/openrc-run +# Copyright 1999-2024 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: $ command="/usr/bin/ebusd" command_args="${EBUSD_OPTS}" -start_stop_daemon_args="--quiet" -description="ebusd, the daemon for communication with eBUS heating systems." +logfile_path="/var/log/ebusd" +logfile="${pidfile_path}/ebusd.log" +name="eBUS daemon" +pidfile_path="/run/ebusd" +pidfile="${pidfile_path}/ebusd.pid" -depend() { - need localmount - use logger +start_pre() { + checkpath -d -q "${logfile_path}" + checkpath -d -q "${pidfile_path}" + checkpath -f -q "${logfile}" } From a9bb6cf862e077ab972f2ee3a6af5ab39ff0eb64 Mon Sep 17 00:00:00 2001 From: Conrad Kostecki Date: Sun, 14 Jan 2024 00:37:22 +0100 Subject: [PATCH 2/2] Add Gentoo systemd unit Signed-off-by: Conrad Kostecki --- contrib/gentoo/systemd/ebusd.service | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 contrib/gentoo/systemd/ebusd.service diff --git a/contrib/gentoo/systemd/ebusd.service b/contrib/gentoo/systemd/ebusd.service new file mode 100644 index 00000000..b66f4435 --- /dev/null +++ b/contrib/gentoo/systemd/ebusd.service @@ -0,0 +1,13 @@ +[Unit] +Description=eBUS daemon +After=network-online.target + +[Service] +Type=forking +User=ebusd +Group=ebusd +ExecStart=/usr/bin/ebusd ${EBUSD_OPTS} +Restart=always + +[Install] +WantedBy=multi-user.target