OpenVZ Forum


Home » Mailing lists » Users » /dev/mem: Permission denied
/dev/mem: Permission denied [message #27738] Mon, 25 February 2008 22:31 Go to next message
Dean Gostisa is currently offline  Dean Gostisa
Messages: 5
Registered: February 2008
Junior Member
Hi,

I have problem, i have created openvz Gentoo Server, and create Debian VM on
it, but when installing some packages like this i get:
apt-get --reinstall install xfonts-base
Reading package lists... Done
Building dependency tree... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not
upgraded.
Need to get 0B/6131kB of archives.
After unpacking 0B of additional disk space will be used.
Do you want to continue [Y/n]? y
(Reading database ... 20054 files and directories currently installed.)
Preparing to replace xfonts-base 1:1.0.0-4 (using
.../xfonts-base_1%3a1.0.0-4_all.deb) ...
/dev/mem: Permission denied
Unpacking replacement xfonts-base ...
/dev/mem: Permission denied
warning: /usr/lib/X11/fonts/misc does not exist or is not a directory
warning: /usr/lib/X11/fonts/misc does not exist or is not a directory
Setting up xfonts-base (1.0.0-4) ...
/dev/mem: Permission denied
warning: /usr/lib/X11/fonts/misc does not exist or is not a directory
warning: /usr/lib/X11/fonts/misc does not exist or is not a directory

Do you have any idea why?

Thank you for your help,
Dean

-- 
Everybody have fun!!!
Re: /dev/mem: Permission denied [message #27755 is a reply to message #27738] Tue, 26 February 2008 10:53 Go to previous messageGo to next message
Pavel Emelianov is currently offline  Pavel Emelianov
Messages: 1149
Registered: September 2006
Senior Member
Dean Gostisa wrote:
> Hi,
> 
> I have problem, i have created openvz Gentoo Server, and create Debian VM on
> it, but when installing some packages like this i get:
> apt-get --reinstall install xfonts-base
> Reading package lists... Done
> Building dependency tree... Done
> 0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not
> upgraded.
> Need to get 0B/6131kB of archives.
> After unpacking 0B of additional disk space will be used.
> Do you want to continue [Y/n]? y
> (Reading database ... 20054 files and directories currently installed.)
> Preparing to replace xfonts-base 1:1.0.0-4 (using
> .../xfonts-base_1%3a1.0.0-4_all.deb) ...
> /dev/mem: Permission denied
> Unpacking replacement xfonts-base ...
> /dev/mem: Permission denied
> warning: /usr/lib/X11/fonts/misc does not exist or is not a directory
> warning: /usr/lib/X11/fonts/misc does not exist or is not a directory
> Setting up xfonts-base (1.0.0-4) ...
> /dev/mem: Permission denied
> warning: /usr/lib/X11/fonts/misc does not exist or is not a directory
> warning: /usr/lib/X11/fonts/misc does not exist or is not a directory
> 
> Do you have any idea why?

Yup - you should give the device permissions to /dev/mem for this VE.
Read man on vzctl for --devnodes option.

> Thank you for your help,
> Dean
> 
> 
> 
> ------------------------------------------------------------------------
>
Re: /dev/mem: Permission denied [message #27763 is a reply to message #27738] Tue, 26 February 2008 14:33 Go to previous messageGo to next message
Dean Gostisa is currently offline  Dean Gostisa
Messages: 5
Registered: February 2008
Junior Member
pic /proc/vz/devperms
.lf 1 /proc/vz/devperms
Version: 2.7
         0 b 016 *:*
         0 c 006 *:*
       104 c 006 1:2

I use Gentoo stable OpenVZ: 2.6.18-028stab053
Should i use newer ?


2008/2/26, Pavel Emelyanov <xemul@openvz.org>:
>
> Dean Gostisa wrote:
> > Um problem remains:
> > I set:
> > vzctl set 104 --devnodes mem:rw --save
> > And restarted VE, then i checked dev nodes in VE:
> > Doktor:/# ls -l /dev/mem
> > crwxrwxrwx 1 root news 1, 1 Apr 24  2007 /dev/mem
>
>
> OK, what's in the /proc/vz/devperms file after ve restart?
> And what's the kernel version you use?
>
>
> > But when i try to install still get same problem:
> > apt-get --reinstall install xfonts-base
> > Reading package lists... Done
> > Building dependency tree... Done
> > 0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not
> > upgraded.
> > Need to get 0B/6131kB of archives.
> > After unpacking 0B of additional disk space will be used.
> > Do you want to continue [Y/n]? Y
> > (Reading database ... 20054 files and directories currently installed.)
> > Preparing to replace xfonts-base 1:1.0.0-4 (using
> > .../xfonts-base_1%3a1.0.0-4_all.deb) ...
> > /dev/mem: Permission denied
> > Unpacking replacement xfonts-base ...
> > /dev/mem: Permission denied
> > warning: /usr/lib/X11/fonts/misc does not exist or is not a directory
> > warning: /usr/lib/X11/fonts/misc does not exist or is not a directory
> > Setting up xfonts-base (1.0.0-4) ...
> > /dev/mem: Permission denied
> > warning: /usr/lib/X11/fonts/misc does not exist or is not a directory
> > warning: /usr/lib/X11/fonts/misc does not exist or is not a directory
> >
> > Any other idea?
> >
> >
> >
> > 2008/2/26, Pavel Emelyanov <xemul@openvz.org>:
> >> Dean Gostisa wrote:
> >>> Hi,
> >>>
> >>> I have problem, i have created openvz Gentoo Server, and create Debian
> >> VM on
> >>> it, but when installing some packages like this i get:
> >>> apt-get --reinstall install xfonts-base
> >>> Reading package lists... Done
> >>> Building dependency tree... Done
> >>> 0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not
> >>> upgraded.
> >>> Need to get 0B/6131kB of archives.
> >>> After unpacking 0B of additional disk space will be used.
> >>> Do you want to continue [Y/n]? y
> >>> (Reading database ... 20054 files and directories currently
> installed.)
> >>> Preparing to replace xfonts-base 1:1.0.0-4 (using
> >>> .../xfonts-base_1%3a1.0.0-4_all.deb) ...
> >>> /dev/mem: Permission denied
> >>> Unpacking replacement xfonts-base ...
> >>> /dev/mem: Permission denied
> >>> warning: /usr/lib/X11/fonts/misc does not exist or is not a directory
> >>> warning: /usr/lib/X11/fonts/misc does not exist or is not a directory
> >>> Setting up xfonts-base (1.0.0-4) ...
> >>> /dev/mem: Permission denied
> >>> warning: /usr/lib/X11/fonts/misc does not exist or is not a directory
> >>> warning: /usr/lib/X11/fonts/misc does not exist or is not a directory
> >>>
> >>> Do you have any idea why?
> >>
> >> Yup - you should give the device permissions to /dev/mem for this VE.
> >> Read man on vzctl for --devnodes option.
> >>
> >>
> >>> Thank you for your help,
> >>> Dean
> >>>
> >>>
> >>>
> >>>
> ------------------------------------------------------------------------
> >>>
-- 
Everybody have fun!!!
Re: /dev/mem: Permission denied [message #27764 is a reply to message #27738] Tue, 26 February 2008 16:06 Go to previous messageGo to next message
Dean Gostisa is currently offline  Dean Gostisa
Messages: 5
Registered: February 2008
Junior Member
Um i used command:
vzctl set 104 --devices c:1:1:rw --save
Restarted VE
Output:
pic /proc/vz/devperms
.lf 1 /proc/vz/devperms
Version: 2.7
         0 b 016 *:*
         0 c 006 *:*
       104 c 006 1:2
       104 c 006 1:1

And system still show me Promission denied on /dev/mem in VE 104. Any idea?

Thank you
Dean

2008/2/26, Pavel Emelyanov <xemul@openvz.org>:
>
> Dean Gostisa wrote:
> > pic /proc/vz/devperms
> > .lf 1 /proc/vz/devperms
> > Version: 2.7
> >          0 b 016 *:*
> >          0 c 006 *:*
> >        104 c 006 1:2
>
>
> Here it is - vzctl added c 1:2 device, not the c 1:1.
> Try the
>
>         vzctl set 104 --devices c:1:1:rw --save
>
> command instead.
>
>
> > I use Gentoo stable OpenVZ: 2.6.18-028stab053
> > Should i use newer ?
>
>
> No. Looks like it's the vzctl fault. Try the above command,
> and if succeed, then upgrade the vzctl if required. If the
> --devnodes still doesn't work - fill the BUG in our bugzilla :)
>
> Thanks,
>
> Pavel
>
>
> >
> > 2008/2/26, Pavel Emelyanov <xemul@openvz.org>:
> >> Dean Gostisa wrote:
> >>> Um problem remains:
> >>> I set:
> >>> vzctl set 104 --devnodes mem:rw --save
> >>> And restarted VE, then i checked dev nodes in VE:
> >>> Doktor:/# ls -l /dev/mem
> >>> crwxrwxrwx 1 root news 1, 1 Apr 24  2007 /dev/mem
> >>
> >> OK, what's in the /proc/vz/devperms file after ve restart?
> >> And what's the kernel version you use?
> >>
> >>
> >>> But when i try to install still get same problem:
> >>> apt-get --reinstall install xfonts-base
> >>> Reading package lists... Done
> >>> Building dependency tree... Done
> >>> 0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not
> >>> upgraded.
> >>> Need to get 0B/6131kB of archives.
> >>> After unpacking 0B of additional disk space will be used.
> >>> Do you want to continue [Y/n]? Y
> >>> (Reading database ... 20054 files and directories currently
> installed.)
> >>> Preparing to replace xfonts-base 1:1.0.0-4 (using
> >>> .../xfonts-base_1%3a1.0.0-4_all.deb) ...
> >>> /dev/mem: Permission denied
> >>> Unpacking replacement xfonts-base ...
> >>> /dev/mem: Permission denied
> >>> warning: /usr/lib/X11/fonts/misc does not exist or is not a directory
> >>> warning: /usr/lib/X11/fonts/misc does not exist or is not a directory
> >>> Setting up xfonts-base (1.0.0-4) ...
> >>> /dev/mem: Permission denied
> >>> warning: /usr/lib/X11/fonts/misc does not exist or is not a directory
> >>> warning: /usr/lib/X11/fonts/misc does not exist or is not a directory
> >>>
> >>> Any other idea?
> >>>
> >>>
> >>>
> >>> 2008/2/26, Pavel Emelyanov <xemul@openvz.org>:
> >>>> Dean Gostisa wrote:
> >>>>> Hi,
> >>>>>
> >>>>> I have problem, i have created openvz Gentoo Server, and create
> Debian
> >>>> VM on
> >>>>> it, but when installing some packages like this i get:
> >>>>> apt-get --reinstall install xfonts-base
> >>>>> Reading package lists... Done
> >>>>> Building dependency tree... Done
> >>>>> 0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not
> >>>>> upgraded.
> >>>>> Need to get 0B/6131kB of archives.
> >>>>> After unpacking 0B of additional disk space will be used.
> >>>>> Do you want to continue [Y/n]? y
> >>>>> (Reading database ... 20054 files and directories currently
> >> installed.)
> >>>>> Preparing to replace xfonts-base 1:1.0.0-4 (using
> >>>>> .../xfonts-base_1%3a1.0.0-4_all.deb) ...
> >>>>> /dev/mem: Permission denied
> >>>>> Unpacking replacement xfonts-base ...
> >>>>> /dev/mem: Permission denied
> >>>>> warning: /usr/lib/X11/fonts/misc does not exist or is not a
> directory
> >>>>> warning: /usr/lib/X11/fonts/misc does not exist or is not a
> directory
> >>>>> Setting up xfonts-base (1.0.0-4) ...
> >>>>> /dev/mem: Permission denied
> >>>>> warning: /usr/lib/X11/fonts/misc does not exist or is not a
> directory
> >>>>> warning: /usr/lib/X11/fonts/misc does not exist or is not a
> directory
> >>>>>
> >>>>> Do you have any idea why?
> >>>> Yup - you should give the device permissions to /dev/mem for this VE.
> >>>> Read man on vzctl for --devnodes option.
> >>>>
> >>>>
> >>>>> Thank you for your help,
> >>>>> Dean
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>
> ------------------------------------------------------------------------
-- 
Everybody have fun!!!
Re: /dev/mem: Permission denied [message #27765 is a reply to message #27738] Tue, 26 February 2008 16:07 Go to previous messageGo to next message
kir is currently offline  kir
Messages: 1645
Registered: August 2005
Location: Moscow, Russia
Senior Member

I have debugged this case a bit and found out that


(1) The "/dev/mem: Permission denied" message comes from 
/usr/sbin/laptop-detect script which is being executed a few times 
during packages installation. Well, in fact the message comes from 
dmidecode which laptop-detect calls... Anyway, laptop-detect decides 
that we are not on a laptop (which is correct for a container I think) 
and exits with the code of 1 (correct in non-laptop case). So it's all 
fine, except for the scary error message which you should ignore (and 
please do NOT give a container an access to /dev/mem -- BAD BAD idea). 
If you want the message to disappear, do this (as root):

rm /usr/sbin/laptop-detect
ln -s /bin/false /usr/sbin/laptop-detect

That way "laptop-detect" is linked to "false" and will always exit with 
"1" (meaning "we are not on a laptop").


(2) The "warning: /usr/lib/X11/fonts/misc does not exist or is not a 
directory" message comes from xfonts-base post-installation script 
(/var/lib/dpkg/info/xfonts-base.postinst) which (aside from tons of 
other things) calls these two scripts:

update-fonts-dir --x11r7-layout misc;update-fonts-alias misc

Each script tries to check if a directory named /usr/lib/X11/fonts/misc 
-- it does not, and it prints a warning.

I am not sure why there is no /usr/lib/X11/fonts/misc directory but 
xfonts-base assumes it's here -- for that, you'd better ask Debian people.

I have also tried to find which packages create the above directory (or 
have files in it) and found out nobody's using it. Instead, a number of 
packages put some files to /usr/share/fonts/X11/misc.


Executive summary:
1. /dev/mem can and should be ignored.
2. warning about directory is not an OpenVZ issue.

Hope that helps.

 Kir.


Dean Gostisa wrote:
> Hi,
>
> I have problem, i have created openvz Gentoo Server, and create Debian 
> VM on it, but when installing some packages like this i get:
> apt-get --reinstall install xfonts-base
> Reading package lists... Done
> Building dependency tree... Done
> 0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not 
> upgraded.
> Need to get 0B/6131kB of archives.
> After unpacking 0B of additional disk space will be used.
> Do you want to continue [Y/n]? y
> (Reading database ... 20054 files and directories currently installed.)
> Preparing to replace xfonts-base 1:1.0.0-4 (using 
> .../xfonts-base_1%3a1.0.0-4_all.deb) ...
> /dev/mem: Permission denied
> Unpacking replacement xfonts-base ...
> /dev/mem: Permission denied
> warning: /usr/lib/X11/fonts/misc does not exist or is not a directory
> warning: /usr/lib/X11/fonts/misc does not exist or is not a directory
> Setting up xfonts-base (1.0.0-4) ...
> /dev/mem: Permission denied
> warning: /usr/lib/X11/fonts/misc does not exist or is not a directory
> warning: /usr/lib/X11/fonts/misc does not exist or is not a directory
>
> Do you have any idea why?
>
> Thank you for your help,
> Dean
>
> -- 
> Everybody have fun!!!
> ------------------------------------------------------------------------
>
Re: /dev/mem: Permission denied [message #27768 is a reply to message #27765] Tue, 26 February 2008 19:10 Go to previous message
Josip Rodin is currently offline  Josip Rodin
Messages: 14
Registered: November 2007
Junior Member
On Tue, Feb 26, 2008 at 07:07:31PM +0300, Kir Kolyshkin wrote:
> (1) The "/dev/mem: Permission denied" message comes from 
> /usr/sbin/laptop-detect script which is being executed a few times 
> during packages installation. Well, in fact the message comes from 
> dmidecode which laptop-detect calls...
> 
> If you want the message to disappear, do this (as root):
> 
> rm /usr/sbin/laptop-detect
> ln -s /bin/false /usr/sbin/laptop-detect

I'd say they should just remove the laptop-detect and dmidecode packages,
because they can serve no particular practical purpose inside a VE anyway...?

(Doing the above without dpkg-divert will last only until the next package
upgrade, in any case.)

-- 
     2. That which causes joy or happiness.
Previous Topic: Log to console.
Next Topic: Debian openvz kernel package security update policy ?
Goto Forum:
  


Current Time: Thu Dec 26 11:53:00 GMT 2024

Total time taken to generate the page: 0.01690 seconds