LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-24-2008, 12:07 PM   #1
Wynd
Member
 
Registered: Jul 2001
Distribution: Slackware 12
Posts: 511

Rep: Reputation: 32
/dev/null is a regular file


Today I started getting permission denied errors when accessing /dev/null. I did a ls -l on it and the permissions are "-rw-r--r--"; that is, not only are the permissions wrong but it is a regular file and not a device. I fixed it by deleting it and using "mknod -m 0666 /dev/null c 1 3", but what could be causing this?
 
Old 01-24-2008, 12:26 PM   #2
Uncle_Theodore
Member
 
Registered: Dec 2007
Location: Charleston WV, USA
Distribution: Slackware 12.2, Arch Linux Amd64
Posts: 896

Rep: Reputation: 71
Well, it might be that your /dev/null was deleted and then some process started to write to it. Then, it would be created again as a regular file. You could've tried to read what in it before deleting it, then you'd had an idea what process wrote to it right after it reappeared. That might have given you an idea of what happened.
Some people suggest creating a cron job like this

test -c /dev/null || echo "/dev/null is missing or a regular file."

PS. Have you by any chance, compiled a kernel as root recently?

Last edited by Uncle_Theodore; 01-24-2008 at 12:28 PM.
 
Old 01-24-2008, 12:29 PM   #3
Wynd
Member
 
Registered: Jul 2001
Distribution: Slackware 12
Posts: 511

Original Poster
Rep: Reputation: 32
Thanks for the advice. I did do "file /dev/null" before I deleted it and it came up as "empty," so I don't know what created it.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
/dev/null file mod changes won't stick on reboot wonderboy1999 MEPIS 10 09-04-2007 11:07 AM
What is meant by " file > /dev/null 2>&1 </dev/null " attockonian Linux - Newbie 5 06-30-2006 10:51 PM
What applicability of a file /dev/null ukrainet Linux - Newbie 1 12-01-2004 09:04 AM
Switch stdout between /dev/null and a file? gremlin2000 Linux - General 2 06-08-2004 07:12 AM
Switch stdout between /dev/null and a file? gremlin2000 Linux - Newbie 1 06-01-2004 10:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:16 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration