Just happened again today: instead of copying a new config file for some app, you copy 'n' paste from the terminal window on one side of your screen, to your vi or emacs session in another terminal window.
So you end up with something that
looks okay, but if there are any long lines in the file, they will be broken up after the paste.
Don't believe me? Copy 'n' paste something like a grub.conf or another file with a long command line from one window to another. That long line will be chopped up by carriage returns. In the case of grub.conf your system will probably not even boot.
Copy:
kernel /vmlinuz-2.6.32-131.0.15.el6.i686 ro root=/dev/mapper/vg_haydn-lv_root rd_LVM_LV=vg_haydn/lv_root rd_LVM_LV=vg_haydn/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us crashkernel=auto rhgb quiet
Paste:
kernel /vmlinuz-2.6.32-131.0.15.el6.i686 ro root=/dev/mapper/vg_hay
dn-lv_root rd_LVM_LV=vg_haydn/lv_root rd_LVM_LV=vg_haydn/lv_swap rd_NO_LUKS
rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=p
c KEYTABLE=us crashkernel=auto rhgb quiet
How do you find such offending files if you are trying to troubleshoot? Open the file in vi and look for telltale spaces at the beginning or end of lines that should be continuous. When moving your vi cursor up and down through the file, the cursor should JUMP over wrapped lines.
Don't be lazy. Use the right commands to make and edit config files.