Gentoo Archives: gentoo-user

From: Kai Krakow <hurikhan77@×××××.com>
To: gentoo-user@l.g.o
Subject: [gentoo-user] Re: systemd questions: hdparm unit file, OpenRC packages
Date: Mon, 10 Apr 2017 15:46:25
Message-Id: 20170410174559.337fb2bc@jupiter.sol.kaishome.de
In Reply to: Re: [gentoo-user] systemd questions: hdparm unit file, OpenRC packages by Rich Freeman
1 Am Mon, 10 Apr 2017 10:48:48 -0400
2 schrieb Rich Freeman <rich0@g.o>:
3
4 > On Mon, Apr 10, 2017 at 3:27 AM, Raffaele Belardi
5 > <raffaele.belardi@××.com> wrote:
6 > > After 10+ years of LXDE/OpenRC I decided to give Gnome/systemd a
7 > > try.
8 > >
9 > > 1. With OpenRC I used hdparm to put an external USB disk to sleep:
10 > >
11 > > $ cat /etc/conf.d/hdparm
12 > > sdb_args="-S24"
13 > >
14 > > Looks like systemd does not provide a unit file for hdparm yet,
15 > > right? If so I suppose I'll have to write my own.
16 > > In general I suppose the same holds for everything that was under
17 > > /etc/local.d/
18 >
19 > As Kai pointed out there are units/generators to run the stuff under
20 > local.d. You could certainly create a unit for hdparm but a local.d
21 > script is probably fine for something done once like this, especially
22 > if there is no need to maintain any kind of state and undo it later.
23
24 KISS principle... ;-)
25
26 > > 2. Which OpenRC-related packages can I unmerge?
27 > > - sys-apps/sysvinit
28 > > - sys-apps/openrc
29
30 Oh I totally left that out...
31
32 > This stuff ends up being pulled in by the system set, but you can
33 > eliminate it if you create a symlink from /lib/gentoo/functions.sh to
34 > /etc/init.d/functions.sh.
35
36 I instead made a file there with the following contents to spot the
37 broken packages:
38
39 $ cat /etc/init.d/functions.sh
40 source /lib/gentoo/functions.sh
41 ewarn "Usage of /etc/init.d/functions.sh is deprecated"
42
43 > Don't ask me why stuff STILL sources the
44 > old location, other than it being so trivial that nobody cares that
45 > much. I've put openrc in package.provided just to avoid the needless
46 > upgrades. You can ditch sysvinit if you set USE=sysv-utils on systemd
47 > (so that you still get stuff like reboot/halt/poweroff, though I'm not
48 > sure how essential those actually are these days).
49
50 Use the following instead if you don't want to fiddle around with
51 versioning in package.provided:
52
53 $ cat /etc/portage/profile/packages
54 -*sys-apps/openrc
55
56 This removes openrc from the system set. You can then use depclean to
57 get rid of the rest but carefully check not to remove essential stuff.
58
59 Thus, I also strongly recommend USE=sysv-utils.
60
61 This is something like:
62
63 > > - app-admin/sysklogd
64 >
65 > Never used it, so obviously you can live without that.
66
67 Indeed not needed.
68
69 > > - cron/anacron after transition to systemd timers
70 >
71 > You might want to also look at sys-process/systemd-cron as a bridge.
72 > It basically generates timer units from your crontab and also runs the
73 > stuff in /etc/cron.*.d/. But, timer scripts also work just fine and I
74 > do that for stuff that I want a bit more control over.
75
76 I don't suggest so. Services don't spawn session which cronjobs may
77 depend upon (most don't, tho). Cron spawns a session in the system
78 context. Both is not the same, so you should carefully decide which
79 cronjob to convert to a timer. Everything in /etc/cron* should work,
80 but timers are not a replacement for cron.
81
82 > > - sys-apps/debianutils provides savelog functionality also provided
83 > > by systemd but also installkernel so I shall not remove it
84 >
85 > I use logrotate personally, and I still need it for stuff that doesn't
86 > use syslog.
87
88 I've ditched all oldschool text log and only use journal now. This made
89 logrotate obsolete (which hardly managed to get all logfiles correctly
90 anyways due to changes in packages default configuration).
91
92 > > - others?
93 >
94 > That depends how far down the rabbit hole you want to go. Systemd has
95 > semi-replacements for stuff like ntpd, dns, etc. They're not intended
96 > as full replacements. If you're serving time/dns/etc then you
97 > probably won't want it. If you just want something to manage it
98 > locally on the host then these are fairly viable replacements. There
99 > is also networkd, which I use on systems that don't have wifi.
100
101 All replacements except systemd-resolved work flawless for me. I'm
102 currently using the systemd resolver but it has its hickups from time
103 to time. This has become much better with the latest systemd version.
104
105 All those services are well integrated with each other and suitable for
106 most stuff. Tho, systemd-networkd is not explicitly developed as a
107 desktop daemon currently, systemd folks still tend to recommend
108 NetworkManager to get all features. The systemd replacement perfectly
109 works for me, tho: My desktop PC is a stationary PC with wired network.
110 If you're mobile or use wifi, ymmv.
111
112 > Systemd basically tries to provide all the essential services from a
113 > client-only perspective.
114
115 Yes, and that's sufficient. It doesn't have to be a server, meta
116 server, or proxy server. And it shouldn't be.
117
118 --
119 Regards,
120 Kai
121
122 Replies to list-only preferred.

Replies

Subject Author
Re: [gentoo-user] Re: systemd questions: hdparm unit file, OpenRC packages Neil Bothwick <neil@××××××××××.uk>
Re: [gentoo-user] Re: systemd questions: hdparm unit file, OpenRC packages Raffaele Belardi <raffaele.belardi@××.com>