Access boot log

When I boot my NixOS system, I see many lines with a green [OK], and one or two with some orrangy [???] (I cannot read it because things happen too fast; but I am afraid of it; it doesn’t go away either; first I thought it was temporary; nixos unstable, you know… :wink:).

How can I access this log when the system has booted up?

Of course, I tried dmesg, and journalctl, but I cannot find the [OK] lines either, so I am a bit lost.


1 Like

The output is not exactly identical, (no nice checkmarks) but you can view the syslog from the start of the current boot with the --boot option: journalctl -b 0.

1 Like

-x can also be helpful with journalctl

Small side note, I recently learned that just specifying --boot or -b without a numerical argument gives you the current boot. This is nice, because personally I could never remember if the current boot is -1 or 0.

1 Like

Thanks for your input! Espcially the -x flag helped a lot. Now I know that network-local-commands.service is failing. I checked this unit, and it is actually doing nothing (but failing)… Not sure how to deal with this.

The unit file is:

# /etc/systemd/system/network-local-commands.service
[Unit] network-setup.service
Description=Extra networking commands.



And the network-local-commands-start script is empty:

 + cat /nix/store/38cnm36971wcxz0wwmw070q0zchh980c-unit-script-network-local-commands-start/bin/network-local-commands-start
set -e
# Run any user-specified commands.

This may be considered a bug. The service is created unconditionally here:

I think it should be behind a mkIf of some kind, given it only does anything if networking.localCommands is defined.

That said, the error is harmless. It probably fails because systemd sees it exiting too quickly? Maybe give journalctl -xe --unit network-local-commands.service a thorough look and share the actual error - the only other failure I could see is that your nix store is corrupted and that bash is missing.

If it’s just exiting too quickly, a sleep 5 in networking.localCommands, or setting"never" (or some other systemd setting I don’t know about off the top of my head) would be a sufficient hack to fix the boot messages, I think.

But why is it failing in the first place? Running an empty bash script shouldn’t be considered a failure at all.

1 Like

OK, I found out why it is failing. An After dependency is missing: network-setup.service. I have no idea why this is the case, I suspect this is a problem with Nixpkgs. I found, but here, the network-setup.service is in the After, and not the BindsTo clause.

EDIT: This specific problem was fixed by the above mentioned PR.

1 Like