!DBFhtjpqmJNENpLDOv:nixos.org

NixOS systemd

624 Members
NixOS ❤️ systemd171 Servers

Load older messages


SenderMessageTime
4 Apr 2025
@elvishjerricco:matrix.orgElvishJerricco gdamjan: that's definitely not true 17:43:02
21 May 2021
@a3don:matrix.orga3don left the room.02:34:04
4 Apr 2025
@elvishjerricco:matrix.orgElvishJerricco the kernel will use one console of each type, e.g. one serial and one VT 17:43:17
21 May 2021
@ninjatrappeur:matrix.orgNinjaTrappeur joined the room.06:59:55
4 Apr 2025
@elvishjerricco:matrix.orgElvishJerricco but /dev/console only corresponds to one of those 17:43:41
21 May 2021
@niksnut:matrix.orgniksnut joined the room.08:11:36
4 Apr 2025
@elvishjerricco:matrix.orgElvishJerricco well, more accurately, among the console= kernel params, it will use one of each type 17:45:24
21 May 2021
@evils.devils:matrix.orgevils joined the room.08:47:40
4 Apr 2025
@gdamjan:spodeli.orggdamjanI stand corrected https://docs.kernel.org/admin-guide/serial-console.html17:46:50
21 May 2021
@jkarlson:kapsi.fiEmil Karlson joined the room.08:55:14
4 Apr 2025
@elvishjerricco:matrix.orgElvishJerriccoyea that's what I quoted from last night :)17:47:02
21 May 2021
@higebu:matrix.orghigebu joined the room.10:20:13
4 Apr 2025
@elvishjerricco:matrix.orgElvishJerricco I think systemd only logs to its systemd.log_target= parameter, which is (effectively) by default the console target, which I think means just /dev/console but might be all console= params. 17:50:20
21 May 2021
@colmeka:matrix.orgcolmeka joined the room.11:35:18
4 Apr 2025
@elvishjerricco:matrix.orgElvishJerricco But that's systemd's own log_* functions; I think it doesn't actually redirect its stdout / stderr at all. And I think the /etc/systemd/system-shutdown/ programs inherit systemd's stdout, which is why our shutdown script's message is no longer going to the serial console 17:54:20
21 May 2021
@andi:kack.itandi- What is our current stance on DynamicUser=true with state directories on different disks/partitions? Mounting fileSystems to /var/lib/private/... has never been a great experience. 14:58:22
4 Apr 2025
@elvishjerricco:matrix.orgElvishJerricco because I think systemd's stdout is just /dev/console, which is exactly one of the console= kernel params, which is now tty0 and not ttyS0 17:55:32
@elvishjerricco:matrix.orgElvishJerriccoI could be wrong about like... all of that though17:56:14
21 May 2021
@gkaply532:matrix.orggkaply532 joined the room.16:18:57
4 Apr 2025
@elvishjerricco:matrix.orgElvishJerricco

https://github.com/systemd/systemd/blob/c1b0e39ffd76ca14960d3253286d9590c36f00f2/src/basic/log.c#L123-L143

Ok, systemd opens /dev/console for logging and then moves the fd out of the < 3 range

18:06:33
21 May 2021
@kalbasit:matrix.orgkalbasit joined the room.16:50:08
@elvishjerricco:matrix.orgElvishJerricco joined the room.16:53:34
4 Apr 2025
@elvishjerricco:matrix.orgElvishJerricco ok but I think it's not actually using that function. Based on main() and log_open(), I think it's defaulting to setting the log target to kmsg for PID1, until the journal starts and it switches to that. At shutdown, based on become_shutdown(), PID1 execs systemd-shutdown with --log-target=kmsg. At no point is stdout or stderr redirected, meaning I think that PID1 and subprocesses like systemd generators or systemd-shutdown scripts will output to /dev/console, which only represents one tty, which is now tty0 in our VM tests 22:04:40
21 May 2021
@emantor:stratum0.orgEmantor joined the room.16:55:28
4 Apr 2025
@elvishjerricco:matrix.orgElvishJerricco And that's why the systemd log output all looked pretty normal despite the change, with the barely noticeable exception that shutdown and generator scripts don't output to ttyS0 anymore 22:05:25
21 May 2021
@rosariopulella:matrix.orgrosariopulella joined the room.19:43:13
4 Apr 2025
@elvishjerricco:matrix.orgElvishJerricco all in all, I think the fix is to have the test's shutdown script pipe its output to /dev/kmsg or something like that, which would have been the dumb workaround I would have used if I hadn't bothered to figure all this out 22:06:52
21 May 2021
@hax404:hax404.dehax404 joined the room.20:42:16
4 Apr 2025
@elvishjerricco:matrix.orgElvishJerriccobut now I feel better about it actually being a good fix :P22:07:00
21 May 2021
@emantor:stratum0.orgEmantor changed their profile picture.20:42:52

Show newer messages


Back to Room ListRoom Version: 6