OpenVZ Forum


Home » General » Support » /dev/null permission denied
/dev/null permission denied [message #24676] Fri, 07 December 2007 16:54 Go to next message
beyondx is currently offline  beyondx
Messages: 21
Registered: October 2007
Junior Member
Hi everyone,

I´ve got a weird problem with the NULL-Device. In fact I just virtualized a fedora3 machine, which worked quite well. Access via SSH etc. is possible. However there´s one problem with the dev/null-device. The Amavis-milter accesses the /dev/null-device combined with etc/profile, which leads to an error --> /dev/null: permission denied.
How can I solve this problem?
I already deleted dev/null and recreated it...as I already said access via ssh is possible and anything else works...except for the point mentioned above.
Any help is appreciated

Thanks,

Norman
Re: /dev/null permission denied [message #24680 is a reply to message #24676] Fri, 07 December 2007 17:54 Go to previous messageGo to next message
maratrus is currently offline  maratrus
Messages: 1495
Registered: August 2007
Location: Moscow
Senior Member
Hi,

1. What kernel do you use?
2. Please look at this page may be it relates with your problem
http://forum.openvz.org/index.php?t=msg&goto=9123&&a mp;srch=%2Fdev%2Fnull+permission#msg_9123
Thank You!
Re: /dev/null permission denied [message #24697 is a reply to message #24676] Fri, 07 December 2007 21:40 Go to previous messageGo to next message
beyondx is currently offline  beyondx
Messages: 21
Registered: October 2007
Junior Member
Thanks for your reply!
I´m using the following kernel on a fedora-core6 machine:
2.6.18-8.1.15.el5.028stab047.1 #1 SMP Tue Oct 23 15:25:33 MSD 2007 i686 i686 i386 GNU/Linux.

I will have a look at your recommended link.
Regards
Norman
Re: /dev/null permission denied [message #25628 is a reply to message #24697] Fri, 04 January 2008 12:15 Go to previous messageGo to next message
beyondx is currently offline  beyondx
Messages: 21
Registered: October 2007
Junior Member
Hi everyone,

unfortunately I´m still having a weird problem with the dev/null-device.
As i already mentioned, I virtualized a fedora-core 3 machine running stuff like amavisd-new, spamassassin etc.
After recreating all devices and other steps mentioned in the HowTo:P2V, everything seems to work fine...the only exception I could figure out is amavisd-new.
Example:

[root@fedora3p2v /]# /etc/init.d/amavisd-new status
amavis-milter is stopped
amavisd is stopped
amavisd-new is stopped

[root@fedora3p2v /]# /etc/init.d/amavisd-new start
Starting amavis-milter: /etc/profile: line 27: /dev/null: Permission denied
/etc/profile.d/colorls.sh: line 3: /dev/null: Permission denied
/etc/profile.d/colorls.sh: line 4: /dev/null: Permission denied
/etc/profile.d/colorls.sh: line 17: /dev/null: Permission denied
/etc/profile.d/colorls.sh: line 18: /dev/null: Permission denied
/etc/profile.d/colorls.sh: line 19: /dev/null: Permission denied
/etc/profile.d/colorls.sh: line 20: /dev/null: Permission denied
/etc/profile.d/vim.sh: line 3: /dev/null: Permission denied
-bash: /dev/null: Permission denied
[ OK ]
Starting amavisd-new: [ OK ]

Does anyone know how to fix that problem? I Already upgraded to the latest openvzkernel:2.6.18-53.el5.028stab051.1

Greetings

Norman
Re: /dev/null permission denied [message #25637 is a reply to message #25628] Fri, 04 January 2008 20:24 Go to previous messageGo to next message
maratrus is currently offline  maratrus
Messages: 1495
Registered: August 2007
Location: Moscow
Senior Member
Hi,

can you please attach the strace output of /etc/init.d/amavisd-new start and also ls -l of /vz/private/<ID>/dev and /vz/root/<ID>/dev?
Re: /dev/null permission denied [message #25639 is a reply to message #25637] Sat, 05 January 2008 08:38 Go to previous messageGo to next message
vaverin is currently offline  vaverin
Messages: 708
Registered: September 2005
Senior Member
Could you please show 'ls -al /dev/null' output?
Re: /dev/null permission denied [message #25668 is a reply to message #24676] Sun, 06 January 2008 17:06 Go to previous messageGo to next message
beyondx is currently offline  beyondx
Messages: 21
Registered: October 2007
Junior Member
Hi everyone,

thanks for your participation in this weird problem. Luckily I could already figure it out myself by having a closer look at the bug report 398.

There you find the following line to set up the rights for the devices such as dev/null

vzctl set <id> --devices c:5:2:rw --save

This setup helped and actually solved the problem.

Before using this command I followed the Howto:"physical to VE", which suggests:

rm -f /vz/private/123/dev/null (if null exists)
mknod /vz/private/123/dev/null c 1 3

This command set the permissions crw-r--r--, which lead to the conflict.

Maybe someone could add this to the wiki.

Greetings,

Norman

PS: Sorry, if this solutions was more than obvious to some of you...I´m still a linux noob :-/
Re: /dev/null permission denied [message #25669 is a reply to message #25639] Sun, 06 January 2008 17:07 Go to previous messageGo to next message
beyondx is currently offline  beyondx
Messages: 21
Registered: October 2007
Junior Member
Hi everyone,

thanks for your participation in this weird problem. Luckily I could already figure it out myself by having a closer look at the bug report 398.

There you find the following line to set up the rights for the devices such as dev/null

vzctl set <id> --devices c:5:2:rw --save

This setup helped and actually solved the problem.

Before using this command I followed the Howto:"physical to VE", which suggests:

rm -f /vz/private/123/dev/null (if null exists)
mknod /vz/private/123/dev/null c 1 3

This command set the permissions crw-r--r--, which lead to the conflict.

Maybe someone could add this to the wiki.

Greetings,

Norman

PS: Sorry, if this solutions was more than obvious to some of you...I´m still a linux noob :-/
Re: /dev/null permission denied [message #25730 is a reply to message #25669] Tue, 08 January 2008 11:00 Go to previous messageGo to next message
maratrus is currently offline  maratrus
Messages: 1495
Registered: August 2007
Location: Moscow
Senior Member
Hi,

1. Can you please start your VPS and show the output 'cat /proc/mounts' from HN?
2. And please output of 'umask' from HN?

Thank You!
Re: /dev/null permission denied [message #25786 is a reply to message #25669] Wed, 09 January 2008 06:57 Go to previous messageGo to next message
vaverin is currently offline  vaverin
Messages: 708
Registered: September 2005
Senior Member
I would note that 'vzctl set --devices c:5:2:rw' command is not required.
First, it is not /dev/null device, it is /dev/ptmx
Second, this device file should have 0666 access permissions too. Obviously you have created it by mknod command, and write permission for user and group was restricted by umask.

Marat has corrected our wiki page, now it recommend to execute mknod with --mode option.

Thank you,
Vasily Averin

Re: /dev/null permission denied [message #46404 is a reply to message #25786] Thu, 17 May 2012 12:51 Go to previous messageGo to next message
iroen is currently offline  iroen
Messages: 1
Registered: March 2012
Location: Poland
Junior Member
I had this problem today and this link (I can't use links so sorry, but I wont show you the source ...) solution helped. By default there was "crw" only on the /dev/null and the problem (in this case the starting of allegrograph server) went away after doing chmod 0666 on the file.
Re: /dev/null permission denied [message #51041 is a reply to message #24676] Mon, 06 January 2014 11:54 Go to previous message
narcisgarcia is currently offline  narcisgarcia
Messages: 41
Registered: May 2009
Member
I'm running Debian 7 containers in Debian 7 HN host (Linux 2.6.32-openvz-042stab084.14-amd64), and found this problem, but not inmediately to container's boot: after several hours (or days).

This command inside the container solves me the problem for some minutes:
chmod a+rw /dev/null

But after those minutes the null device comes back to bad permissions crw-r--r--

Now I've tried this at the hardware node:
ContainerID=777
vzctl set $ContainerID --devnodes null:rw --save
vzctl stop $ContainerID
vzctl start $ContainerID


But after some time, trying to use bash-completion (pressing TAB on a terminal), I see the same problem:
Quote:
-bash: /dev/null: Permission denied
bash: _upvars: `-a2': invalid number specifier


I'M SORRY;
At this moment I think that a customized script re-created the "file" /dev/null when doesn't find it with "test -f":
rm -f $MyFile
echo "MyData" > $MyFile

BUT the strange OpenVZ behaviour is that this operation seems to spread to all other containers: one container re-creates /dev/null and all others' have this device modified.


Narcis Garcia

[Updated on: Tue, 07 January 2014 09:54]

Report message to a moderator

Previous Topic: Unable to fork: Cannot allocate memory but websites loading
Next Topic: Force date shift in VM
Goto Forum:
  


Current Time: Fri Apr 19 15:25:38 GMT 2024

Total time taken to generate the page: 0.01887 seconds