random-archer / mkinitcpio-systemd-tool

Provisioning tool for systemd in initramfs (systemd-tool)
https://www.archlinux.org/packages/community/any/mkinitcpio-systemd-tool/
Other
112 stars 27 forks source link

mysterious path resolution in initrd #72

Open dorianpb opened 4 years ago

dorianpb commented 4 years ago

If i do enable initrd-tinysshd.service, it boots up fine but complains "Error: No such file or directory" about 13-15 times in a row, then complains two more times later.The logs in journalctl don't seem to show any of this, though. I'm also booting with plymouth. I have these initrd-* units enabled: (I didn't edit any of them) initrd-plymouth.path initrd-shell.service initrd-sysroot-mount.service initrd-tinysshd.service

I can post more info than this but I don't really know what you guys would need to see.

Andrei-Pozolotin commented 4 years ago

please read through wiki pages and related issues first, see if that brings up any ideas: https://github.com/random-archer/mkinitcpio-systemd-tool/wiki

dorianpb commented 4 years ago

Okay, I spend a while looking through all of the issues I could find and none of them really helped me or addressed my problem. This is mostly because I have no idea what's causing it.

dorianpb commented 4 years ago

After spending a lot of time and inserting a lot of "echo" commands into your initrd-shell.sh script, I found that all of the "Failed to execute process: No such file or directory" complaints were coming from line 65 in initrd-shell.sh. echo "$text" | $systemd_cat --priority="$mode" --identifier="$script_identifier" Commenting this line out stops all of the errors from being printed and the system still boots normally.

Andrei-Pozolotin commented 4 years ago

please confirm:

  1. /usr/bin/systemd-cat is present both on root system and as part of initrramfs

  2. command below produces expected log entry visible with journalctl -e:

    echo "hello-there" | systemd-cat --priority="info" --identifier="hello-kitty"
dorianpb commented 4 years ago

Sorry for my delayed response, my internet was kinda crapping out a lot recently.

  1. /usr/bin/systemd-cat is present in both the root filesystem and on the initramfs (I used lsinitcpio to check)
  2. On the root filesystem, this works. On the debug shell within the initramfs, it doesn't. It produces the Failed to execute process: No such file or directoryerror
Andrei-Pozolotin commented 4 years ago

On the debug shell within the initramfs, it doesn't.

  1. you mean /usr/bin/systemd-cat actually runs but produces that specific error?

  2. try to add strace to the initramfs image and then run this test under strace, to see specifically what/where is it complaining about https://linux.die.net/man/1/strace

dorianpb commented 4 years ago
  1. Yes
  2. It's complaining about the file /etc/of.so.preload Also, I wanted to note that running the command like this systemd-cat --priority="info" --identifier="hello-kitty" echo "hello-there" gives the expected output in journalctl
Andrei-Pozolotin commented 4 years ago

wanted to note that running the command like this

you mean not using absolute path to the executable?

dorianpb commented 4 years ago

It worked for me without using the absolute path.