I have a bunch of journal setting I normally change in /etc/systemd/journald.conf.
In fedora40 there doesn't appear to be such a file.
Where are journal settings configured these days?
On Tue, 7 May 2024 14:09:57 -0400 Tom Horsley wrote:
I have a bunch of journal setting I normally change in /etc/systemd/journald.conf.
In fedora40 there doesn't appear to be such a file.
It gets more confusing. If I do (in fedora 40) a
rpm -q --list systemd
/etc/systemd/journald.conf
Appears in the list of files owned by systemd, but if I look in /etc/systemd on a fedora 40 image installed directly from the workstation dvd image, that file doesn't exist.
Will it pay attention to the settings if I create it?
Tom Horsley composed on 2024-05-07 14:09 (UTC-0400):
I have a bunch of journal setting I normally change in /etc/systemd/journald.conf.
In fedora40 there doesn't appear to be such a file.
Where are journal settings configured these days?
/etc/systemd/journald.conf.d/ for overrides & customizations.
Tom Horsley composed on 2024-05-07 14:34 (UTC-0400):
On Tue, 7 May 2024 14:19:46 -0400 Felix Miata wrote:
/etc/systemd/journald.conf.d/ for overrides & customizations.
A directory which also doesn't exist :-).
Like other /etc/**.conf.d/ directories in a systemd environment, it's optional, a place to override things one isn't happy with in the /usr/ tree.
# cat /etc/systemd/journal.conf.d/local.conf [Journal] Storage=persistent SystemMaxFiles=10 RuntimeMaxFiles=12 ForwardToConsole=yes TTYPath=/dev/tty10 Audit=no #
On Tue, May 7, 2024 at 2:20 PM Felix Miata mrmazda@earthlink.net wrote:
Tom Horsley composed on 2024-05-07 14:09 (UTC-0400):
I have a bunch of journal setting I normally change in /etc/systemd/journald.conf.
In fedora40 there doesn't appear to be such a file.
Where are journal settings configured these days?
/etc/systemd/journald.conf.d/ for overrides & customizations.
++, this.
Then, when you perform a system-upgrade and run `rpmconf -a`, you will always get the maintainer's version of the file, and you will always override to suit your taste.
Jeff
On Tue, 7 May 2024 14:19:46 -0400 Felix Miata wrote:
Where are journal settings configured these days?
/etc/systemd/journald.conf.d/ for overrides & customizations.
So if I put a .conf file in that directory, does it also need to have the [Journal] line at the beginning? Like so:
[Journal] option=setting option=setting...
On 9 May 2024, at 14:15, Tom Horsley horsley1953@gmail.com wrote:
So if I put a .conf file in that directory, does it also need to have the [Journal] line at the beginning? Like so:
[Journal] option=setting option=setting...
Yes. See man journald.conf
Barry
On 9 May 2024, at 14:56, Tom Horsley horsley1953@gmail.com wrote:
Yes. See man journald.conf
I did see the man page, it wasn't clear (not to me, anyway).
From the man page:
OPTIONS All options are configured in the [Journal] section:
Storage= Controls where to store journal data. One of "volatile", ...
Barry
On Thu, 9 May 2024 19:15:20 +0100 Barry Scott wrote:
All options are configured in the [Journal] section:
Yep, but it is concatenating all the different bits and pieces it picks up from the journald.conf.d directory, so is the [Journal] in the default file enough to imply [Journal] for all the pieces it picks up from the directory? I mean, what if [Journal] means "Forget everything, we're starting journal options now"? The last thing you'd want to do is put in a [Journal] line in that case and forget all the previous settings :-).
[Train of thought like this is what happens when a computer programmer tries to read an ambiguous manual].
On Thu, May 9, 2024 at 3:14 PM Tom Horsley horsley1953@gmail.com wrote:
On Thu, 9 May 2024 19:15:20 +0100 Barry Scott wrote:
All options are configured in the [Journal] section:
Yep, but it is concatenating all the different bits and pieces it picks up from the journald.conf.d directory, so is the [Journal] in the default file enough to imply [Journal] for all the pieces it picks up from the directory? I mean, what if [Journal] means "Forget everything, we're starting journal options now"? The last thing you'd want to do is put in a [Journal] line in that case and forget all the previous settings :-).
[Train of thought like this is what happens when a computer programmer tries to read an ambiguous manual].
When it comes to configuration using the .d/ directories, I believe it is a "sticky" scheme. The first time the option is set, it becomes sticky and it is not overridden later. That's why applications read .d/ configuration files first (and in a deterministic order, like 10-*.conf before 50-*.conf files), and then fallback to the package's or maintainer's configuration options for missing options.
Jeff
On Thu, May 09, 2024 at 03:45:54PM -0400, Jeffrey Walton wrote:
On Thu, May 9, 2024 at 3:14 PM Tom Horsley horsley1953@gmail.com wrote:
On Thu, 9 May 2024 19:15:20 +0100 Barry Scott wrote:
All options are configured in the [Journal] section:
Yep, but it is concatenating all the different bits and pieces it picks up from the journald.conf.d directory, so is the [Journal] in the default file enough to imply [Journal] for all the pieces it picks up from the directory? I mean, what if [Journal] means "Forget everything, we're starting journal options now"? The last thing you'd want to do is put in a [Journal] line in that case and forget all the previous settings :-).
[Train of thought like this is what happens when a computer programmer tries to read an ambiguous manual].
When it comes to configuration using the .d/ directories, I believe it is a "sticky" scheme. The first time the option is set, it becomes sticky and it is not overridden later. That's why applications read .d/ configuration files first (and in a deterministic order, like 10-*.conf before 50-*.conf files), and then fallback to the package's or maintainer's configuration options for missing options.
"journald.conf(5) describes it differently. Below I've broken up a single paragraph from that manpage.
In addition to the "main" configuration file, drop-in configuration snippets are read from /usr/lib/systemd/*.conf.d/, /usr/local/lib/systemd/*.conf.d/, and /etc/systemd/*.conf.d/. Those drop-ins have higher precedence and override the main configuration file.
So even if a line in the "main" config file is uncommentted, it value is not "sticky".
Files in the *.conf.d/ configuration subdirectories are sorted by their filename in lexicographic order, regardless of in which of the subdirectories they reside.
So with multiple drop-in config files, their name, not directory location, determines the order read.
When multiple files specify the same option, for options which accept just a single value, the entry in the file sorted last takes precedence,
So no option setting is sticky, it is last setting read rules.
and for options which accept a list of values, entries are collected as they occur in the sorted files.
HTH,
On Thu, May 9, 2024 at 5:59 PM Jon LaBadie jonfu@jgcomp.com wrote:
On Thu, May 09, 2024 at 03:45:54PM -0400, Jeffrey Walton wrote:
On Thu, May 9, 2024 at 3:14 PM Tom Horsley horsley1953@gmail.com wrote:
On Thu, 9 May 2024 19:15:20 +0100 Barry Scott wrote:
All options are configured in the [Journal] section:
Yep, but it is concatenating all the different bits and pieces it picks up from the journald.conf.d directory, so is the [Journal] in the default file enough to imply [Journal] for all the pieces it picks up from the directory? I mean, what if [Journal] means "Forget everything, we're starting journal options now"? The last thing you'd want to do is put in a [Journal] line in that case and forget all the previous settings :-).
[Train of thought like this is what happens when a computer programmer tries to read an ambiguous manual].
When it comes to configuration using the .d/ directories, I believe it is
a
"sticky" scheme. The first time the option is set, it becomes sticky and
it
is not overridden later. That's why applications read .d/ configuration files first (and in a deterministic order, like 10-*.conf before 50-*.conf files), and then fallback to the package's or maintainer's configuration options for missing options.
"journald.conf(5) describes it differently. Below I've broken up a single paragraph from that manpage.
In addition to the "main" configuration file, drop-in configuration snippets are read from /usr/lib/systemd/*.conf.d/, /usr/local/lib/systemd/*.conf.d/, and /etc/systemd/*.conf.d/. Those drop-ins have higher precedence and override the main configuration file.
So even if a line in the "main" config file is uncommentted, it value is not "sticky".
Files in the *.conf.d/ configuration subdirectories are sorted by their filename in lexicographic order, regardless of in which of the subdirectories they reside.
So with multiple drop-in config files, their name, not directory location, determines the order read.
When multiple files specify the same option, for options which accept just a single value, the entry in the file sorted last takes precedence,
So no option setting is sticky, it is last setting read rules.
and for options which accept a list of values, entries are collected as they occur in the sorted files.
My bad, I stand corrected.
Jeff
On Thu, 9 May 2024 15:12:57 -0400, Tom Horsley wrote:
I mean, what if [Journal] means "Forget everything, we're starting journal options now"? The last thing you'd want to do is put in a [Journal] line in that case and forget all the previous settings :-).
That's an odd thought in my opinion, since [Foo] typically is an .INI-style section specification that doesn't reset any variable=value assignments within that named section.
Tom Horsley composed on 2024-05-09 09:15 (UTC-0400):
On Tue, 7 May 2024 14:19:46 -0400 Felix Miata wrote:
Where are journal settings configured these days?
/etc/systemd/journald.conf.d/ for overrides & customizations.
So if I put a .conf file in that directory, does it also need to have the [Journal] line at the beginning? Like so:
[Journal] option=setting option=setting...
I think this is what you want:
man systemd.syntax
On Tue, 2024-05-07 at 14:09 -0400, Tom Horsley wrote:
I have a bunch of journal setting I normally change in /etc/systemd/journald.conf.
In fedora40 there doesn't appear to be such a file.
It's there on my system, updated from F39:
# rpm -qf /etc/systemd/journald.conf systemd-255.4-1.fc40.x86_64
Try running 'rpm -V systemd'.
poc
On Tue, 07 May 2024 21:38:47 +0100 Patrick O'Callaghan wrote:
# rpm -qf /etc/systemd/journald.conf systemd-255.4-1.fc40.x86_64
Try running 'rpm -V systemd'.
Everything seems normal, I think they just did some kind of voodoo to the rpm so it owns the file if it exists, but it doesn't actually install a file because all the defaults are built in. I guess I just have to create it myself if I want to change defaults.
On Tue, 2024-05-07 at 16:54 -0400, Tom Horsley wrote:
On Tue, 07 May 2024 21:38:47 +0100 Patrick O'Callaghan wrote:
# rpm -qf /etc/systemd/journald.conf systemd-255.4-1.fc40.x86_64
Try running 'rpm -V systemd'.
Everything seems normal, I think they just did some kind of voodoo to the rpm so it owns the file if it exists, but it doesn't actually install a file because all the defaults are built in. I guess I just have to create it myself if I want to change defaults. --
I'm 100% sure I've never touched this file, so it must have came as part of the package.
poc
On Tue, 07 May 2024 21:38:47 +0100, Patrick O'Callaghan wrote:
It's there on my system, updated from F39:
# rpm -qf /etc/systemd/journald.conf systemd-255.4-1.fc40.x86_64
No, it's not:
$ rpm -qcv systemd|grep conf$ -rw-r--r-- 1 root root 0 Mar 1 01:00 /etc/X11/xorg.conf.d/00-keyboard.conf -rw-r--r-- 1 root root 21 Mar 1 01:00 /etc/dnf/protected.d/systemd.conf -rw-r--r-- 1 root root 0 Mar 1 01:00 /etc/locale.conf -rw-r--r-- 1 root root 0 Mar 1 01:00 /etc/systemd/journald.conf -rw-r--r-- 1 root root 0 Mar 1 01:00 /etc/systemd/logind.conf -rw-r--r-- 1 root root 0 Mar 1 01:00 /etc/systemd/system.conf -rw-r--r-- 1 root root 0 Mar 1 01:00 /etc/systemd/user.conf
It's a %ghost config file, which means it is marked as belonging to the package (even if it doesn't exist in the directory), so it can be handled appropriately on package removal/updates.
The default file has been moved to /usr/lib/systemd/journald.conf.
On Tue, 2024-05-07 at 23:29 +0200, Michael Schwendt wrote:
On Tue, 07 May 2024 21:38:47 +0100, Patrick O'Callaghan wrote:
It's there on my system, updated from F39:
# rpm -qf /etc/systemd/journald.conf systemd-255.4-1.fc40.x86_64
No, it's not:
$ rpm -qcv systemd|grep conf$ -rw-r--r-- 1 root root 0 Mar 1 01:00 /etc/X11/xorg.conf.d/00-keyboard.conf -rw-r--r-- 1 root root 21 Mar 1 01:00 /etc/dnf/protected.d/systemd.conf -rw-r--r-- 1 root root 0 Mar 1 01:00 /etc/locale.conf -rw-r--r-- 1 root root 0 Mar 1 01:00 /etc/systemd/journald.conf -rw-r--r-- 1 root root 0 Mar 1 01:00 /etc/systemd/logind.conf -rw-r--r-- 1 root root 0 Mar 1 01:00 /etc/systemd/system.conf -rw-r--r-- 1 root root 0 Mar 1 01:00 /etc/systemd/user.conf
It's a %ghost config file, which means it is marked as belonging to the package (even if it doesn't exist in the directory), so it can be handled appropriately on package removal/updates.
The default file has been moved to /usr/lib/systemd/journald.conf.
In that case I assume it was put there under F39. Seems very odd that the upgrade just kept it in addition to the one in /usr/lib/systemd.
poc
On Tue, 07 May 2024 23:22:53 +0100, Patrick O'Callaghan wrote:
In that case I assume it was put there under F39. Seems very odd that the upgrade just kept it in addition to the one in /usr/lib/systemd.
Depends.
You cannot rely on just "rpm -qf ..." since that only queries the package file list regardless of what the file contents are. And that includes %ghost files which possibly don't exist. Also, it is not only a %ghost file but also still marked as %config, and if it has been modified by you, RPM package upgrades would handle it like a config file.
What is in your /etc/systemd/journald.conf file compared with the default in /usr/lib/systemd/journald.conf?
On Wed, 2024-05-08 at 01:12 +0200, Michael Schwendt wrote:
On Tue, 07 May 2024 23:22:53 +0100, Patrick O'Callaghan wrote:
In that case I assume it was put there under F39. Seems very odd that the upgrade just kept it in addition to the one in /usr/lib/systemd.
Depends.
You cannot rely on just "rpm -qf ..." since that only queries the package file list regardless of what the file contents are. And that includes %ghost files which possibly don't exist. Also, it is not only a %ghost file but also still marked as %config, and if it has been modified by you, RPM package upgrades would handle it like a config file.
As stated earlier, it hasn't been modified by me.
What is in your /etc/systemd/journald.conf file compared with the default in /usr/lib/systemd/journald.conf?
They are identical except for comments:
$ diff /etc/systemd/journald.conf /usr/lib/systemd/journald.conf 9,11c9,13 < # should be created by either modifying this file, or by creating "drop-ins" in < # the journald.conf.d/ subdirectory. The latter is generally recommended. < # Defaults can be restored by simply deleting this file and all drop-ins. ---
# should be created by either modifying this file (or a copy of it placed in # /etc/ if the original file is shipped in /usr/), or by creating "drop-ins" in # the /etc/systemd/journald.conf.d/ directory. The latter is generally # recommended. Defaults can be restored by simply deleting the main # configuration file and all drop-ins located in /etc/.
poc
On Wed, 08 May 2024 10:49:12 +0100, Patrick O'Callaghan wrote:
As stated earlier, it hasn't been modified by me.
What is in your /etc/systemd/journald.conf file compared with the default in /usr/lib/systemd/journald.conf?
They are identical except for comments:
That proves my point. The file contents don't come from within the systemd package where the file is just a %ghost.
On Wed, 2024-05-08 at 12:25 +0200, Michael Schwendt wrote:
On Wed, 08 May 2024 10:49:12 +0100, Patrick O'Callaghan wrote:
As stated earlier, it hasn't been modified by me.
What is in your /etc/systemd/journald.conf file compared with the default in /usr/lib/systemd/journald.conf?
They are identical except for comments:
That proves my point. The file contents don't come from within the systemd package where the file is just a %ghost.
Then it must have come from some previous iteration of the package. I note that it has been there a long time:
$ ls -l --time=creation /etc/systemd/journald.conf /usr/lib/systemd/journald.conf -rw-r--r--. 1 root root 1282 Jul 16 2022 /etc/systemd/journald.conf -rw-r--r--. 1 root root 1406 Apr 24 12:36 /usr/lib/systemd/journald.conf
poc