OpenVZ Forum


Home » General » Support » yum.repo per VE
Re: yum.repo per VE [message #23704 is a reply to message #21728] Thu, 22 November 2007 23:25 Go to previous message
Sambo is currently offline  Sambo
Messages: 2
Registered: November 2007
Junior Member
Hi.. this is the way I achieved this.. for better or worse:

Firstly, I copied the yum.conf file from /vz/templates/centos/4/i386/conf/ into the /etc directory of the VE itself and call it vzyum.conf (e.g: /vz/private/211/etc/vzyum.conf )

Then I made a small change to the yum_conf() function in /usr/share/vzpkg/functions script, as follows:

# Returns -c parameters needed for yum.
function yum_conf()
{
        local tdir=$1
        local template=$TEMPLATE
        if test -z "$template"; then
                template=`get_vz_var TEMPLATE`
        fi
        local cfg=$tdir/config/yum.conf
        local spcfg=$VE_ROOT/etc/vzyum.conf  ## PER-VE conf file
        # FIXME: check for osset-specific yum.conf
        test -f $cfg || abort "yum repository config file " \
                "($cfg) not found!"
        ## USE Per-VE conf file if exists
        #echo "-c $cfg"
        if [ -f $spcfg ]; then
                echo "-c $spcfg"
        else
                echo "-c $cfg"
        fi
}



It was just a quick hack.. could probably be cleaned up (eg the file existence test logic).

The downside is that it means a process on the hardware node itself is accessing a file inside the VE, which I'm not sure is a good idea.

The upside is that migrating the VE from one node to another doesn't affect it, as the vzyum.conf file travels with it.

This means that each VE can have it's own specific set of repositories (rpmforge, etc) and updates can be managed from the hardware node taking advantage of caching, etc. A script to mass-update all VE's becomes trivial.

The only thing to watch is that an update doesn't overwrite the functions file, which could inadvertantly down-grade packages on the VE. It would be better if a permenant solution was put in place.

cheers
sam

[Updated on: Thu, 22 November 2007 23:36]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Fail to compile 2.6.18-028stab049.1 on amd64 machine
Next Topic: sysctl, kernel.sem, kernel.shmmax etc.
Goto Forum:
  


Current Time: Sun Aug 03 23:04:10 GMT 2025

Total time taken to generate the page: 0.64831 seconds