Subject: Re: [vserver] recommended way of maintaining or doing 'apt-get upgrade' in a guest?
From: Corey Wright <undefined@pobox.com>
Date: Tue, 27 Jan 2009 17:56:46 -0600

On Wed, 28 Jan 2009 01:39:26 +0800
"Jeffrey 'jf' Lim" <jfs.world@gmail.com> wrote:

> (pasted from another thread about the "one-liner
> /etc/apt/sources.list" - but I figure this one deserves another thread
> of its own...) I'm getting problems like the following when doing an
> 'apt-get upgrade' in a guest:

i intended to reply earlier to this email in the other thread, but didn't
have the time until now.

> ---
> (Reading database ... 8025 files and directories currently installed.)
> Preparing to replace base-files 4.0.1ubuntu5 (using
> .../base-files_4.0.1ubuntu5.8.04.4_amd64.deb) ...
> Unpacking replacement base-files ...
> Setting up base-files (4.0.1ubuntu5.8.04.4) ...
> Installing new version of config file /etc/issue ...
> Installing new version of config file /etc/issue.net ...
> Installing new version of config file /etc/lsb-release ...
> find: /var/cache/fontconfig: No such file or directory
> find: /var/cache/fonts: No such file or directory
> find: /var/cache/anthy: No such file or directory
> find: /var/lib/gconf: No such file or directory
> find: /var/lib/defoma: No such file or directory
> find: /var/log/installer: No such file or directory
> find: /initrd.img: No such file or directory
> find: /vmlinuz: No such file or directory
> find: /cdrom: No such file or directory
> find: /media/cdrom: No such file or directory
> find: /usr/share/fonts: No such file or directory
> find: /var/lib/anthy: No such file or directory
> find: /var/lib/defoma: No such file or directory
> find: /lib/modules: No such file or directory
> --

that comes from the base-files' postinst
(/var/lib/dpkg/info/base-files.postinst, lines 158-202).  it tried to
execute "find" on those paths, but those paths didn't exist.  this isn't
necessarily specific to vserver guests and i wouldn't worry about it.

> --
> Setting up procps (1:3.2.7-5ubuntu3) ...
>  * Setting kernel variables...
> error: "Operation not permitted" setting key "kernel.printk"
> error: "Operation not permitted" setting key "kernel.maps_protect"
> error: "Operation not permitted" setting key "fs.inotify.max_user_watches"
> error: "vm.mmap_min_addr" is an unknown key
> error: "Operation not permitted" setting key
> "net.ipv4.conf.default.rp_filter" error: "Operation not permitted"
> setting key "net.ipv4.conf.all.rp_filter" ...fail!
> --

this is because /etc/init.d/procps.sh executes "sysctl -p" which tries to
write values from /etc/sysctl.conf to /proc/sys, but those /proc entries
are read-only within a guest.  this is because of linux-vserver and
harmless, but admittedly noisy.

unless there's a "/etc/vservers/.distributions/hardy/initpost" or
"/usr/lib/util-vserver/distributions/hardy/initpost" (or whatever the
equivalent paths are for your source install) that removes unneeded
initscripts (like /usr/lib/util-vserver/distributions/debian/initpost,
lines 125-139), then you'll have similar noise on guest startup or
shutdown.  and even then after some packages upgrade you have to manually
clean up their reenabling of the init scripts (or extract what the inipost
script does into a separate script).

> While I reckon that these aren't critical errors, is there some sort
> of "recommended way" for upgrading the files in a guest?

either "vapt-get <vservers> -- (update|upgrade|dist-upgrade)" or "vserver
<vserver> exec apt-get (update|upgrade|dist-upgrade)".

corey
-- 
undefined@pobox.com