Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions modules.d/00systemd/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -228,13 +228,23 @@ install() {

mkdir -p "$initdir/etc/systemd"
# We must use a volatile journal, and we don't want rate-limiting
# and want early startup messages to go everywhere kernel buffer does
{
echo "[Journal]"
echo "Storage=volatile"
echo "RateLimitInterval=0"
echo "RateLimitBurst=0"
echo "ForwardToConsole=yes"
echo "ForwardToKMsg=yes"
echo "MaxLevelKMsg=info"
} >> "$initdir/etc/systemd/journald.conf"

mkdir -p "$initdir/etc/sysctl.d"
# Also disable rate-limiting at kernel ring buffer level
{
echo "kernel.printk_devkmsg = on"
} >> "$initdir/etc/sysctl.d/10-dont-ratelimit-kmsg.conf"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the biggest problem here is that the default for this setting (ratelimit) will not get restored after this has run. I don't know how to resolve that. Really I only want to change it to on during initramfs and after that drop it back to whatever it was set to before (either the default or the value from the kernel command line).

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If printk.devkmsg= is set from the kernel command line, this won't even work, at least according to the docs:

printk_devkmsg:

Control the logging to /dev/kmsg from userspace:

ratelimit: default, ratelimited
on: unlimited logging to /dev/kmsg from userspace
off: logging to /dev/kmsg disabled

The kernel command line parameter printk.devkmsg= overrides this and is
a one-time setting until next reboot: once set, it cannot be changed by
this sysctl interface anymore.

If you set it via sysctl, though, it shouldn't be any problem setting it back to ratelimit again once journald is online. The lockout only seems to apply when it's set from the kernel command line. (At least, I just flipped it between on and ratelimit three times on my F28 box using sysctl, with no apparent problems.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahh, i think that's actually good news. IOW if a user sets it from the CLI then we don't have to worry about stepping on them. so if we set it and then set it back to the default after switch root then we'd be fine


ln_r "${systemdsystemunitdir}/multi-user.target" "${systemdsystemunitdir}/default.target"
}