/dev/null: permission denied

/dev/null: permission denied

Post by Gregory Gaskil » Tue, 24 Oct 2000 04:00:00



I'm running FreeBSD 4.1.1 stable and for some mysterious reason everything
sent to /dev/null gives me a permission denied message...even if I perform
the command as root. I noticed this problem when I wanted to direct the
output of a cron job to /dev/null and instead got a /dev/null: permission
denied email every morning. Some other posts I've found suggest a permission
problem...but does not seem to be the case here:

su-2.04# ls -ld / /dev
drwxr-xr-x  17 root  wheel    512 Oct  8 16:31 /
drwxr-xr-x   3 root  wheel  12800 Oct  9 17:39 /dev

su-2.04# ls -l null
crw-rw-rw-  1 root  wheel    2,   2 Oct 23 02:03 null

Anyone have this problem? Anyone know how to fix??? Thanks for any ideas!

 
 
 

/dev/null: permission denied

Post by Bernard Stein » Tue, 24 Oct 2000 04:00:00




Quote:> su-2.04# ls -l null
> crw-rw-rw-  1 root  wheel    2,   2 Oct 23 02:03 null

> Anyone have this problem? Anyone know how to fix??? Thanks for any ideas!

Not me... but here's some thoughts:
1) Try ls -lo /dev/null and check the file flags [chflags(2)].
2) Dunno whether / must be mounted rw to write-access /dev/null
3) Do not revoke(2) /dev/null (nor /dev/mem :-)Z

Bernard

 
 
 

/dev/null: permission denied

Post by Gregory Gaskil » Wed, 25 Oct 2000 11:31:53


Quote:> Not me... but here's some thoughts:
> 1) Try ls -lo /dev/null and check the file flags [chflags(2)].

su-2.04# ls -lo /dev/null
crw-rw-rw-  1 root  wheel  -   2,   2 Oct 23 18:34 /dev/null
I'm not exactly sure what file flags are...the chflags man page tell me how
to change 'em...but any idea what it should be for /dev/null? The flags are
the 2, 2 right?

Quote:> 2) Dunno whether / must be mounted rw to write-access /dev/null

I have not changed any permissions anywhere except in the /home partition so
I don't know why they would have changed from the default. I'm gonna make
world soon and see if that fixes this.

Quote:> 3) Do not revoke(2) /dev/null (nor /dev/mem :-)Z

Not sure what you mean here, but I won't do it! Thanks for the thoughts...
Quote:

> Bernard

 
 
 

/dev/null: permission denied

Post by Richard Tob » Wed, 25 Oct 2000 04:00:00




>su-2.04# ls -l null
>crw-rw-rw-  1 root  wheel    2,   2 Oct 23 02:03 null

Looks like something succeeded in writing to it at around 2am...

What do you get if you try

  truss dd </dev/zero of=/dev/null count=1

-- Richard

--
Spam filter: to mail me from a .com/.net site, put my surname in the headers.

printf("%.*s\n", len, str);

 
 
 

/dev/null: permission denied

Post by Gregory Gaskil » Thu, 26 Oct 2000 10:27:56


Quote:> >su-2.04# ls -l null
> >crw-rw-rw-  1 root  wheel    2,   2 Oct 23 02:03 null

> Looks like something succeeded in writing to it at around 2am...

One of my cronjobs is supposed to send it's output the /dev/null at 2:30am 3
days a week. That is when I realized there probably is a problem as I get an
email those 3 days saying /dev/null: permission denied.

Quote:> What do you get if you try

>   truss dd </dev/zero of=/dev/null count=1

I'm not sure what all this means, but I get:

su-2.04# truss dd </dev/zero of=/dev/null count=1
readlink("/etc/malloc.conf",0xbfbffa40,63)       ERR#2 'No such file or
directory'
mmap(0x0,4096,0x3,0x1002,-1,0x0)                 = 671449088 (0x28058000)
break(0x805e000)                                 = 0 (0x0)
break(0x805f000)                                 = 0 (0x0)
fstat(0,0xbfbffaa0)                              = 0 (0x0)
ioctl(0,FIODTYPE,0xbfbffa9c)                     = 0 (0x0)
open("/dev/null",1538,0666)                      = 3 (0x3)
fstat(3,0xbfbffaa0)                              = 0 (0x0)
ioctl(3,FIODTYPE,0xbfbffa9c)                     = 0 (0x0)
break(0x8060000)                                 = 0 (0x0)
gettimeofday(0xbfbffb34,0x0)                     = 0 (0x0)
sigaction(SIGINFO,0xbfbffb18,0xbfbffb00)         = 0 (0x0)
sigaction(SIGINT,0xbfbffb08,0xbfbffaf0)          = 0 (0x0)
read(0x0,0x805f000,0x200)                        = 512 (0x200)
write(3,0x805f000,512)                           = 512 (0x200)
gettimeofday(0xbfbffa90,0x0)                     = 0 (0x0)
1+0 records in
1+0 records out
write(2,0xbfbffaac,31)                           = 31 (0x1f)
512 bytes transferred in 0.007317 secs (69973 bytes/sec)
write(2,0xbfbffaac,57)                           = 57 (0x39)
exit(0x0)                                       process exit, rval = 0

Does that shed any light on the problem? Thanks!

Quote:> -- Richard

> --
> Spam filter: to mail me from a .com/.net site, put my surname in the
headers.

> printf("%.*s\n", len, str);

 
 
 

/dev/null: permission denied

Post by Richard Tob » Thu, 26 Oct 2000 04:00:00




>open("/dev/null",1538,0666)                      = 3 (0x3)

This is successfully opening /dev/null.  There doesn't seem to be any
problem!

Are you *sure* that the failing program is trying to write to /dev/null?
You don't have some syntax error in your cron job such as:

  cat /etc/motd & /dev/null

Can you send an example of typing in a command and having it fail?

-- Richard
--
Spam filter: to mail me from a .com/.net site, put my surname in the headers.

printf("%.*s\n", len, str);

 
 
 

/dev/null: permission denied

Post by Gregory Gaskil » Thu, 26 Oct 2000 04:00:00


Well this is pretty embarrassing!

A line in my crontab was:
30 2 * * 1,3,5 /usr/local/sbin/newports 2>&1 | /dev/null

It should be:
30 2 * * 1,3,5 /usr/local/sbin/newports 2>&1 > /dev/null

Thanks for your help!
Operator error was the big problem on this one.




> >open("/dev/null",1538,0666)                      = 3 (0x3)

> This is successfully opening /dev/null.  There doesn't seem to be any
> problem!

> Are you *sure* that the failing program is trying to write to /dev/null?
> You don't have some syntax error in your cron job such as:

>   cat /etc/motd & /dev/null

> Can you send an example of typing in a command and having it fail?

> -- Richard
> --
> Spam filter: to mail me from a .com/.net site, put my surname in the
headers.

> printf("%.*s\n", len, str);

 
 
 

1. bash: /dev/null: permission denied Error Message

Hi all,

I have a remote server (in a mine high up in the Peruvian andes) which
this week is being administered by an assistant of mine while I am on
vacation.  And 'mysterously' my PostgreSQL's Postmaster is not running
and we cannot seem to get it re-started.

I believe that my assistant has done something stupid to my server.  Now
  when I telnet my server, after a login with my username & password the
first thing the server returns is:

bash: /dev/null: permission denied
bash: /dev/null: permission denied

Checking the /var/log/message I have also noticed that sendmail is also
not starting.

Does anyone have any idea what could be happened and how I can get it
backup up and running?  I really do need my postgresql database up and
running. ( And I would really like to go back home to the states for
christmas vaction in two more days for the first time in 4 years!!)

Thanks

Phillip J. Allen

2. test

3. /dev/null Permission denied! ??

4. Intermittent kernel init bug on Hitachi Laptop

5. sh: /dev/null : permission denied on 3.2 RELEASE

6. newbie on raw devices

7. /dev/null: Permission denied

8. cd-rom

9. /dev/null permission denied

10. Why sez "bash: /dev/null: Permission denied" ???

11. (/dev/ttyS1): Permission denied cu: /dev/ttyS1: Line in use Connection lost

12. HELP: 2>&1 > /dev/null != 2>&- > /dev/null ???

13. cp /dev/null or cat /dev/null