| 4 Apr 2025 |
ElvishJerricco | gdamjan: that's definitely not true | 17:43:02 |
| 21 May 2021 |
| a3don left the room. | 02:34:04 |
| 4 Apr 2025 |
ElvishJerricco | the kernel will use one console of each type, e.g. one serial and one VT | 17:43:17 |
| 21 May 2021 |
| NinjaTrappeur joined the room. | 06:59:55 |
| 4 Apr 2025 |
ElvishJerricco | but /dev/console only corresponds to one of those | 17:43:41 |
| 21 May 2021 |
| niksnut joined the room. | 08:11:36 |
| 4 Apr 2025 |
ElvishJerricco | well, more accurately, among the console= kernel params, it will use one of each type | 17:45:24 |
| 21 May 2021 |
| evils joined the room. | 08:47:40 |
| 4 Apr 2025 |
gdamjan | I stand corrected https://docs.kernel.org/admin-guide/serial-console.html | 17:46:50 |
| 21 May 2021 |
| Emil Karlson joined the room. | 08:55:14 |
| 4 Apr 2025 |
ElvishJerricco | yea that's what I quoted from last night :) | 17:47:02 |
| 21 May 2021 |
| higebu joined the room. | 10:20:13 |
| 4 Apr 2025 |
ElvishJerricco | 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 joined the room. | 11:35:18 |
| 4 Apr 2025 |
ElvishJerricco | 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- | 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 | 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 | I could be wrong about like... all of that though | 17:56:14 |
| 21 May 2021 |
| gkaply532 joined the room. | 16:18:57 |
| 4 Apr 2025 |
ElvishJerricco | 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 joined the room. | 16:50:08 |
| ElvishJerricco joined the room. | 16:53:34 |
| 4 Apr 2025 |
ElvishJerricco | 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 joined the room. | 16:55:28 |
| 4 Apr 2025 |
ElvishJerricco | 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 joined the room. | 19:43:13 |
| 4 Apr 2025 |
ElvishJerricco | 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 joined the room. | 20:42:16 |
| 4 Apr 2025 |
ElvishJerricco | but now I feel better about it actually being a good fix :P | 22:07:00 |
| 21 May 2021 |
| Emantor changed their profile picture. | 20:42:52 |