[Users] /dev/mem: Permission denied

Kir Kolyshkin kir at openvz.org
Tue Feb 26 11:07:31 EST 2008


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!!!
> ------------------------------------------------------------------------
>
> _______________________________________________
> Users mailing list
> Users at openvz.org
> https://openvz.org/mailman/listinfo/users
>   



More information about the Users mailing list