Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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
4  
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
add comment

2 Answers 2

up vote 7 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
add comment

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
add comment

Your Answer

 
discard

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.