Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 937799 - sys-apps/hd-idle-1.05-r2: Drop-in hd-idle-dropin.d/00gentoo.conf not used
Summary: sys-apps/hd-idle-1.05-r2: Drop-in hd-idle-dropin.d/00gentoo.conf not used
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Oliver Freyermuth
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2024-08-12 07:56 UTC by Johannes Geiss
Modified: 2024-09-14 09:55 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge-info,6.61 KB, text/plain)
2024-08-12 07:56 UTC, Johannes Geiss
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Johannes Geiss 2024-08-12 07:56:50 UTC
Created attachment 899929 [details]
emerge --info

The drop-in /etc/systemd/system/hd-idle.service.d/00gentoo.conf is not used.

systemctl status hd-idle shows the process

/usr/sbin/hd-idle -i 180 -l /var/log/hd-idle.log

If we want to override this using /etc/systemd/system/hd-idle.service.d/00gentoo.conf, eg.

ExecStart=/usr/sbin/hd-idle -i 180

and restart it

systemctl daemon-reload
systemctl restart hd-idle

we still see the process

/usr/sbin/hd-idle -i 180 -l /var/log/hd-idle.log
Comment 1 Oliver Freyermuth 2024-08-12 18:28:24 UTC
Many thanks for the report! Not sure how that escaped my testing earlier. 

an you confirm that using the lines:

ExecStart=
ExecStart=/usr/sbin/hd-idle -i 180

in the override file /etc/systemd/system/hd-idle.service.d/00gentoo.conf instead of just the second line works as exepcted?
Comment 2 Oliver Freyermuth 2024-08-12 18:33:09 UTC
Another addendum: It must be:

[Service]
ExecStart=
ExecStart=/usr/sbin/hd-idle -i 180

If that works for you as expected, I'll update the example later on to include the section, both lines, and a note on how to use them. Sorry for the missing lines!
Comment 3 Johannes Geiss 2024-08-13 07:59:44 UTC
(In reply to Oliver Freyermuth from comment #2)
> Another addendum: It must be:
> 
> [Service]
> ExecStart=
> ExecStart=/usr/sbin/hd-idle -i 180
> 

I've got it.

You are right, but you have to use

hd-idle.service.d, not hd-idle-dropin.d

I have now:

hd-idle.service.d/00gentoo.conf containing

[Service]
ExecStart=
ExecStart=/usr/sbin/hd-idle -i 30

systemctl cat hd-idle tells me now correctly

# /usr/lib/systemd/system/hd-idle.service
# 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

# /etc/systemd/system/hd-idle.service.d/00gentoo.conf
[Service]
ExecStart=
ExecStart=/usr/sbin/hd-idle -i 30
Comment 4 Oliver Freyermuth 2024-08-13 10:34:22 UTC
Thanks for confirming. Yes, indeed, the path must be /etc/systemd/system/hd-idle.service.d/00gentoo.conf (the package already uses that). 

I have submitted a PR to update the drop in config file to contain the necessary lines and more targeted usage instructions as version sys-apps/hd-idle-1.05-r3, as soon as this is merged and in-tree for a while, I will also trigger stabilization of the revbumped version. 

Thanks again for the report!
Comment 5 Larry the Git Cow gentoo-dev 2024-08-28 06:53:02 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e7b5339f5bc2a2fce20ef5ec50744706e92bb08f

commit e7b5339f5bc2a2fce20ef5ec50744706e92bb08f
Author:     Oliver Freyermuth <o.freyermuth@googlemail.com>
AuthorDate: 2024-08-13 10:27:28 +0000
Commit:     Joonas Niilola <juippis@gentoo.org>
CommitDate: 2024-08-28 06:52:59 +0000

    sys-apps/hd-idle: fix and clarify systemd dropin example file
    
    Closes: https://bugs.gentoo.org/937799
    Signed-off-by: Oliver Freyermuth <o.freyermuth@googlemail.com>
    Closes: https://github.com/gentoo/gentoo/pull/38130
    Signed-off-by: Joonas Niilola <juippis@gentoo.org>

 sys-apps/hd-idle/files/hd-idle-service-dropin.conf | 35 ++++++++++++++++++++++
 sys-apps/hd-idle/hd-idle-1.05-r3.ebuild            | 33 ++++++++++++++++++++
 2 files changed, 68 insertions(+)
Comment 6 Johannes Geiss 2024-09-08 10:13:10 UTC
I'm sorry to inform you about this issue which is not completely fixed.

The content of the override file "00gentoo.conf" is correct, but the path

/etc/systemd/system/hd-idle-service-dropin.d/00gentoo.conf must be
/etc/systemd/system/hd-idle.service.d/00gentoo.conf
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-09-08 10:23:00 UTC
That doesn't make it invalid, it means it should be reopened.
Comment 8 Johannes Geiss 2024-09-08 10:56:15 UTC
(In reply to Sam James from comment #7)
> That doesn't make it invalid, it means it should be reopened.

OK, sorry. Next time I'll do it right.
Comment 9 Oliver Freyermuth 2024-09-08 12:31:22 UTC
Thanks for the follow-up report. I'm sorry I missed the details of how systemd_install_serviced chooses the path before. 

The path will be fixed by https://github.com/gentoo/gentoo/pull/38522 .
Comment 10 Larry the Git Cow gentoo-dev 2024-09-14 09:55:45 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f32a2550ebe5f5affdd2db5c80b06ccb8f55f411

commit f32a2550ebe5f5affdd2db5c80b06ccb8f55f411
Author:     Oliver Freyermuth <o.freyermuth@googlemail.com>
AuthorDate: 2024-09-08 12:28:34 +0000
Commit:     Florian Schmaus <flow@gentoo.org>
CommitDate: 2024-09-14 09:53:48 +0000

    sys-apps/hd-idle: fix systemd dropin file install location
    
    Closes: https://bugs.gentoo.org/937799
    Signed-off-by: Oliver Freyermuth <o.freyermuth@googlemail.com>
    Closes: https://github.com/gentoo/gentoo/pull/38522
    Signed-off-by: Florian Schmaus <flow@gentoo.org>

 sys-apps/hd-idle/hd-idle-1.05-r4.ebuild | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)