[K12OSN] dup2 : Bad file descriptor

Glenn Arnold garnold at unrealsolutions.com
Thu Aug 5 00:10:57 UTC 2004


Well, I had a scare today! I restarted my RHEL 3.0 box and when it
started to boot it displayed the following error:
dup2 : Bad file descriptor

Then server was at a rescue prompt.  Prompting me to enter root password
to fix file system.  I restarted the server and boot off the RHEL 3.0
cd1 and entered rescue mode.  I ran fsck on / partition and everthing
was clean.  I searched google on dup2: Bad file descriptor and found the
answer.

rm -f /dev/null
mknod -m 666 /dev/null c 1 3

I could not get the mknod command to work like I found on google, so I
did this
mknod /dev/null c 1 3
chmod 0666 /dev/null
chown root:root /dev/null

Restarted server.  Server is up and working fine.  What I like to know
is why this happened?  What is /dev/null?  Has anyone else had this
experience?

Thanks
-Glenn





More information about the K12OSN mailing list