Whenever I boot my gentoo laptop, openrc hangs forever in the "Caching service dependencies..." stage. This causes my computer to be unbootable unless I use a sysrq key to kill it and manually boot the system.

Using ps as a diagnostic tool, I found that the grep and cut programs (children of a script gendepends.sh) were hanging, using 0% CPU. Killing these programs allowed the boot process to continue properly, after invoking openrc default.

Anyway, I could use many methods to fudge around this problem, but I'd like to know the most likely cause and fix it properly.

Here's the relevant output of pstree when I try to resolve dependencies manually:

  |                       |   `-doas /lib/rc/bin/rc-depend -u
  |                       |       `-rc-depend -u
  |                       |           `-gendepends.sh /lib64/rc/sh/gendepends.sh
  |                       |               `-gendepends.sh /lib64/rc/sh/gendepends.sh
  |                       |                   `-gendepends.sh /lib64/rc/sh/gendepends.sh
  |                       |                       |-cut -d = -f 2
  |                       |                       |-grep pid
  |                       |                       |-tr -d \\"
  |                       |                       `-tr -d [:space:]

In gendepends.sh, these commands are not mentioned anywhere, so I assume they are invoked from another script which was sourced by it.

EDIT: I've fixed the problem now. It turned out to be caused by an old init script with unresolvable dependencies which was still lying around in my initscripts directory for some reason. Deleting the script solved the problem. Thanks for the suggestions.


These commands don't hang out of nowhere; they must have been invoked by some init script, but perhaps with wrong parameters or expecting non-existent data. I can imagine that they wait for some input which just isn't provided.

In the output of ps -ef you find the ID of the parent process (PPID), which is probably the culprit; you could also try pstree for a better overview. Try to figure out the script line where the command(s) are invoked, and perhaps you can figure out the reason why the process and as a result the complete boot process hangs.

If you're not able to point out the issue then add the output of ps -ef to your question (you may shorten it to the hanging command and its parents up to PID 0), and the init script if one is involved.

  • You're probably correct in saying that they are waiting for input, given the fact that they are not using any CPU time. I've added the output of pstree to my question. – sadljkfhalskdjfh Dec 16 '17 at 3:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.