Gentoo Archives: gentoo-user

From: Raffaele Belardi <raffaele.belardi@××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Re: systemd questions: hdparm unit file, OpenRC packages
Date: Tue, 11 Apr 2017 07:30:36
Message-Id: 2c415650-dd0f-4888-af7f-7556e38f488f@st.com
In Reply to: [gentoo-user] Re: systemd questions: hdparm unit file, OpenRC packages by Kai Krakow
1 Kai Krakow wrote:
2 > Am Mon, 10 Apr 2017 09:27:57 +0200
3 > schrieb Raffaele Belardi <raffaele.belardi@××.com>:
4 >
5 >> Looks like systemd does not provide a unit file for hdparm yet,
6 >> right? If so I suppose I'll have to write my own.
7 >> In general I suppose the same holds for everything that was
8 >> under /etc/local.d/
9 >
10 > I've put the hdparm stuff in /etc/local.d:
11 >
12 > $ cat /etc/local.d/hdparm.start
13 > #!/bin/sh
14 >
15 > for device in /sys/bus/scsi/devices/[012345]:0:0:0/block/*; do
16 > hdparm -W1B254S241M254 /dev/$(basename $device)
17 > done
18 >
19 > Make it chmod +x.
20 >
21 > Then install the gentoo integration packet for systemd which creates
22 > the proper units on the fly during boot:
23 >
24 > $ emerge -a sys-apps/gentoo-systemd-integration
25 >
26 > After restart, you should see units started for each local.d script.
27 > It's implemented as a systemd generator. To see how it works, look at
28 > "equery f gentoo-systemd-integration" and have a look at the generator
29 > files.
30
31 Worked perfectly, thank you. gentoo-systemd-integration was already present in the system,
32 I just invoked directly the generator script that it installs.
33
34 raffaele