1 |
On Wed, Feb 18, 2015 at 10:12 PM, James <wireless@×××××××××××.com> wrote: |
2 |
> |
3 |
> Ok |
4 |
> |
5 |
> So I'm reading about systemd support in ebuilds; just trying to |
6 |
> understand the beast wee bit better. |
7 |
> |
8 |
> In in this ebuild: www-misc/monitorix (A lightweight system monitoring |
9 |
tool)f |
10 |
> |
11 |
> the newest version has added this line to the ebuild: |
12 |
> |
13 |
> "systemd_dounit docs/${PN}.service" |
14 |
> |
15 |
> |
16 |
> Looking that the systemd.eclass, all I see is: |
17 |
> "systemd_dounit <unit>... |
18 |
> Install systemd unit(s). Uses doins, thus it is fatal in EAPI 4 and |
19 |
> non-fatal in earlier EAPIs. " |
20 |
> |
21 |
> Which seems reasonable, but tells me nothing what the line does. I can |
22 |
> speculate that monitorix becomes a registered process, if you are |
23 |
> running systemd, but is otherwise ignored on a openrc based system? |
24 |
|
25 |
It just installs the file in the place where systemd reads its unit |
26 |
files: /usr/lib/systemd/system. There was a time when the Gentoo devs where |
27 |
still debating if it should be /usr/lib/systemd/system |
28 |
or /lib/systemd/system; having an ebuild function doing the install helped |
29 |
to avoid checking which one to use, and to be consistent. |
30 |
|
31 |
So, in short: "systemd_dounit <units>" just puts the "<units>" |
32 |
in /usr/lib/systemd/system. There is no "registration"; systemd will read |
33 |
the unit the next time the machine boots or earlier if you do "systemctl |
34 |
daemon-reload", but the service will not be started nor enabled until the |
35 |
user specifies (that's the Gentoo policy, I believe). |
36 |
|
37 |
> It would seem to me the devmanual needs some more "prose" so on can |
38 |
> discern what the systemd.eclass is doing. And yea, I'm off to look |
39 |
> at the code for systemd.eclass as I'm sure it's clear as mud..... |
40 |
|
41 |
It's actually quite short and clear. |
42 |
|
43 |
> The trouble is I find this code everywhere with google. So where |
44 |
> is the best place to read the current systemd.eclass code and where |
45 |
> do I look at the 9999 stuffage; ?should? I become curious about that |
46 |
> eclass or other eclass codes.....? |
47 |
|
48 |
http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/eclass/systemd.eclass?view=markup |
49 |
|
50 |
or locally: |
51 |
|
52 |
/usr/portage/eclass/systemd.eclass |
53 |
|
54 |
I don't understand what the 9999 has to do with the eclass. |
55 |
|
56 |
> guidance and insight is appreciated. |
57 |
|
58 |
Since all of systemd's configuration is really short text files and |
59 |
symlinks to them, the eclass is really simple. Less than a couple dozen |
60 |
functions, most of them involved with installing text files (unit files, |
61 |
tmpfiles.d files, etc.), and some with maintenance of the journal. |
62 |
|
63 |
Regards. |
64 |
-- |
65 |
Canek Peláez Valdés |
66 |
Profesor de asignatura, Facultad de Ciencias |
67 |
Universidad Nacional Autónoma de México |