Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Question within a question (from the Debian wiki):

Should I use sid on my desktop?

If you think you can handle a broken Debian system, sure. Do you know what to do if libpam0g breaks, preventing all logins? Do you know what to do if grep breaks, causing the boot process to hang forever? These things have happened. They will happen again.

My question is, how does a broken grep cause the boot process to hang forever?

share|improve this question
One mistake I've made with grep is grep -r pattern . > pattern.grep. Since the shell creates the output file before invoking grep, the grep command searches the output file, which grows until the disk fills up. I have no idea whether this is related to anything that could cause the boot process to hang forever. – Keith Thompson Feb 8 '12 at 22:11
up vote 8 down vote accepted

It's common for boot scripts to call grep at some point. If grep hangs because of a bug, the first of these boot scripts that calls grep will hang. Or, more commonly, if one of these scripts is broken and calls grep without supplying a file name argument and without redirecting the input, grep will sit around forever waiting for console input (that's not so bad if you're in front of the console and can type Ctrl+D). If a script is broken and calls grep on a pipe or device where nobody is writing… too bad.

share|improve this answer

Well, the obvious way would be "grep hangs forever, so something that uses grep hangs forever, and something in the boot process does that".

The text is likely to be illustrative rather than literal examples of problems, but it isn't impossible.

To really understand, start reading at /etc/init.d/rc and /etc/init.d/rcS - those are the shell scripts that run all the bits that bring up your system.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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