Re: yum.repo per VE [message #23704 is a reply to message #21728] |
Thu, 22 November 2007 23:25  |
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
|
|
|