On Tue, Mar 21, 2000 at 09:10:44PM +0000, Matthew Sammon wrote:
>> While logged in as root a shell script I was messing with did the
> following:
> cp /dev/null /tmp/temp1
> ....
> rm --force /tmp/temp1
> rm --force /dev/null
>> With the result that /dev/null now appears as:
> 5979 -rw------- 1 root root 21 Mar 21 21:03 null
What's happened is that, after you deleted /dev/null, some daemon
or script or something is writing to /dev/null, probably by shell
redirection, causing it to be re-created as an ordinary file.
> I cannot remove or rename this corrupt /dev/null, it always remains
> there, so when I try to do a :
> mknod /dev/null c 000 000
> I get:
> mknod: /dev/null: File exists
>> Any ideas as to how to fix this, as several programs are complaining
> about the situation at regular intervals (zsh syslogd etc..)
Do this
# mv -f dev/null /dev/null-tmp && mknod /dev/null c 1 3 && rm -f /dev/null-tmp
If it doesn't work, keeping trying it until it does work.
The offending background script might run between the mv and
the mknod, creating /dev/null as a file again.
Later,
Kenn
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!