Re: s6/s6-rc policy for Gentoo: The logging directory

From: Paul Sopka <psopka_at_sopka.ch>
Date: Sat, 13 Jul 2024 12:04:40 +0200

> On my setup, logs are stored under a dot-directory in my home directory,
> which avoids needing any cooperation from root when setting up user
> services (and the mentioned risk of overlap between user and system
> services).
Since I have a system service setting up the user service tree, this is
a non-issue for me. As of now, this service just creates a user owned
subdir /var/log/s6/user/${USER}, where all logs from ${USER} go. Thus
the main thing probably ends up weighing "having all logs at one
place"(at /var/log/s6) against "having all user-stuff as well as the
logs in one place" (at ~/).

If I now compare this to ${XDG_RUNTIME_DIR} and the service dir of the
s6 user-tree, it follows that, should I have the logs at "~/...", why do
I have "${XDG_RUNTIME_DIR} as well as the service dir of the user" at
/run/...

It is clear that those should reside in tmpfs for speed and the elegance
of self clean up on boot, should something go wrong. I would consider
mounting an tmpfs for every user having set up user-services at "~/"
needlessly complicated and overkill.

For consistency reasons it then follows that the user tree logs should
be in a dir at /var/log/s6/users/${USER} or something comparable, as the
"${XDG_RUNTIME_DIR} and service dir of the user" are at
/run/user/${USER} or comparable. With the nice bonus of having all the
logs in one place.

What do you think about that reasoning?


> Due to /var == ~/.local/state according to the XDG spec (which, from your
> other threads, you seem to want to follow closely), you might want to use
> "${HOME}/.local/state/log/${daemon}" [1].

I do not *want* to adhere to the XDG spec, it just seemed sensible to me
and nobody has provided any reason against it so far.

Anyway,  [1] made me think about why not to use a "/"-like structure
under "~/" (e.g. ~/.var, ~/.etc) instead of the XDG spec. Can you point
me to any thread/list discussing that?

> [1]https://forum.artixlinux.org/index.php/topic,6918.msg41919.html#msg41919


I wish you a very nice weekend!


Paul

Received on Sat Jul 13 2024 - 12:04:40 CEST

This archive was generated by hypermail 2.4.0 : Sun Jul 14 2024 - 11:30:31 CEST