summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver Freyermuth <o.freyermuth@googlemail.com>2023-01-25 23:13:34 +0100
committerJoonas Niilola <juippis@gentoo.org>2023-02-09 15:29:37 +0200
commitf367f6a6be36721959a7d638b1388b4589d098aa (patch)
treed3525c80f2b339e790f5552693a140bd8fcdc7d8 /sys-apps/hd-idle
parentsys-fs/bees: EAPI 7->8 (diff)
downloadgentoo-f367f6a6be36721959a7d638b1388b4589d098aa.tar.gz
gentoo-f367f6a6be36721959a7d638b1388b4589d098aa.tar.bz2
gentoo-f367f6a6be36721959a7d638b1388b4589d098aa.zip
sys-apps/hd-idle: systemd units must not use conf.d
Add a drop-in file to allow configuration for systemd users and inform about the change via elog. Also, bump to EAPI 8 and use https for HOMEPAGE. Closes: https://bugs.gentoo.org/892005 Signed-off-by: Oliver Freyermuth <o.freyermuth@googlemail.com> Closes: https://github.com/gentoo/gentoo/pull/29270 Signed-off-by: Joonas Niilola <juippis@gentoo.org>
Diffstat (limited to 'sys-apps/hd-idle')
-rw-r--r--sys-apps/hd-idle/files/hd-idle-dropin.conf30
-rw-r--r--sys-apps/hd-idle/files/hd-idle.service12
-rw-r--r--sys-apps/hd-idle/hd-idle-1.05-r2.ebuild34
3 files changed, 76 insertions, 0 deletions
diff --git a/sys-apps/hd-idle/files/hd-idle-dropin.conf b/sys-apps/hd-idle/files/hd-idle-dropin.conf
new file mode 100644
index 000000000000..d8c9eea5ff89
--- /dev/null
+++ b/sys-apps/hd-idle/files/hd-idle-dropin.conf
@@ -0,0 +1,30 @@
+# Copyright 1999-2023 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# override settings for hd-idle
+
+# hd-idle command line options
+# Options are:
+# -a Set (partial) device name of disks for subsequent
+# idle-time parameters (-i). This parameter is optional
+# in the sense that there's a default entry for all
+# disks which are not named otherwise by using this
+# parameter.
+# -i <idle_time> Idle time in seconds.
+# -l <logfile> Name of logfile (written only after a disk has spun
+# up). Please note that this option might cause the
+# disk which holds the logfile to spin up just because
+# another disk had some activity. This option should
+# not be used on systems with more than one disk
+# except for tuning purposes. On single-disk systems,
+# this option should not cause any additional spinups.
+#
+# Options not exactly useful here:
+# -t <disk> Spin-down the specfified disk immediately and exit.
+# -d Debug mode. This will prevent hd-idle from
+# becoming a daemon and print debugging info to
+# stdout/stderr
+# -h Print usage information.
+
+# To override, uncomment the following line to override ExecStart:
+#ExecStart=/usr/sbin/hd-idle -i 180 -l /var/log/hd-idle.log
diff --git a/sys-apps/hd-idle/files/hd-idle.service b/sys-apps/hd-idle/files/hd-idle.service
new file mode 100644
index 000000000000..4b33904483bc
--- /dev/null
+++ b/sys-apps/hd-idle/files/hd-idle.service
@@ -0,0 +1,12 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+[Unit]
+Description=hd-idle - spinning down HDDs after a period of idle time
+Documentation=man:hd-idle(1)
+
+[Service]
+Type=forking
+ExecStart=/usr/sbin/hd-idle -i 180 -l /var/log/hd-idle.log
+
+[Install]
+WantedBy=multi-user.target
diff --git a/sys-apps/hd-idle/hd-idle-1.05-r2.ebuild b/sys-apps/hd-idle/hd-idle-1.05-r2.ebuild
new file mode 100644
index 000000000000..4a75d8212141
--- /dev/null
+++ b/sys-apps/hd-idle/hd-idle-1.05-r2.ebuild
@@ -0,0 +1,34 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit linux-info systemd
+
+DESCRIPTION="Utility for spinning down hard disks after a period of idle time"
+HOMEPAGE="https://hd-idle.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS=""
+
+S="${WORKDIR}/${PN}"
+
+CONFIG_CHECK="~PROC_FS"
+
+DOCS=( debian/changelog README )
+
+src_install() {
+ default
+ systemd_newunit "${FILESDIR}"/hd-idle.service ${PN}.service
+ systemd_install_serviced "${FILESDIR}"/hd-idle-dropin.conf
+ newinitd "${FILESDIR}"/hd-idle-init hd-idle
+ newconfd "${FILESDIR}"/hd-idle-conf hd-idle
+
+ elog "The systemd unit file for hd-idle no longer sources ${EPREFIX}/etc/conf.d/hd-idle ."
+ elog "Configuration is still done via ${EPREFIX}/etc/conf.d/hd-idle for OpenRC systems"
+ elog "while for systemd systems, a systemd drop-in file located at"
+ elog "${EPREFIX}/etc/systemd/system/hd-idle.service.d/00gentoo.conf"
+ elog "is used for configuration."
+}