[tools] mrepo, RHEL 5 and rhnget
Frédéric PICA
frederic.pica at gmail.com
Mon May 14 13:47:40 CEST 2007
Great, that's working !
Here it's what I've done :
- Extracted the /usr/share/rhn directory to another one like
/usr/share/rhn_old from an up2date rpm coming from RHEL4
- Created /etc/sysconfig/rh/sources containing : up2date default
- Created /etc/sysconfig/rhn/up2date-uuid containing :
-----------------------
uuid[comment]=Universally Unique ID for this server
rhnuuid=UUID
-----------------------
With UUID generated by /usr/bin/uuidgen
- Changed the first lines of /usr/bin/rhnget :
from
-----------------------
if os.path.exists('/usr/share/rhn/') and os.path.exists
('/usr/share/rhn/up2date_client/'):
sys.path.insert(0, '/usr/share/rhn/')
sys.path.insert(1, '/usr/share/rhn/up2date_client/')
else:
die(1,'up2date is not installed. Aborting execution')
-----------------------
to
-----------------------
if os.path.exists('/usr/share/rhn_old/') and os.path.exists
('/usr/share/rhn_old/up2date_client/'):
sys.path.insert(0, '/usr/share/rhn_old/')
sys.path.insert(1, '/usr/share/rhn_old/up2date_client/')
else:
die(1,'up2date is not installed. Aborting execution')
-----------------------
And it should work !
Thanks for your help dag, sorry for not having completely read the
documentation of mrepo.
Regards,
FP
2007/5/14, Dag Wieers <dag at wieers.com>:
>
> On Mon, 14 May 2007, Frédéric PICA wrote:
>
> > Ok, I'm loosing my hairs with the redhat config !!!
>
> Don't !
>
>
> > I've set up correctly the up2date conf file.
> > To be sure that config.py:initUp2dateConfig return a proxy I've done
> that :
> >
> > if cfg['enableProxy']:
> > if cfg['httpProxy']:
> > # more fixes for %157070, make sure proxyHost is in the
> > format httplib requies
> > # (aka, just one http://)
> > proxyHost = cfg['httpProxy']
> > if proxyHost[:7] != "http://":
> > proxyHost = "http://%s" % proxyHost
> > else:
> > cfg['enableProxy']=1
> > cfg['httpProxy']="xxxxx.xxxxx:3128" # I've replaced by x my
> > proxy addr in the mail
> > proxyHost = cfg['httpProxy']
> > if proxyHost[:7] != "http://":
> > proxyHost = "http://%s" % proxyHost
> >
> > os.environ["HTTP_PROXY"] = proxyHost
> >
> > Now, in rpcServer.py:getServer, it still didn't find the proxy !!!!!!!!!
> >
> > log = up2dateLog.initLog()
> > cfg = config.initUp2dateConfig()
> >
> > [...]
> >
> > log.log_me("Looking for proxy : %s" % cfg["enableProxy"])
> > if cfg["enableProxy"]:
> > proxyHost = up2dateUtils.getProxySetting()
> > else:
> > proxyHost = None
> >
> > #I've added that to be able to use the proxy, like the way
> > config.pydoes because in the log file, cfg["enableProxy"]
> > # is still not set to 1
> >
> > cfg['enableProxy']=1
> > cfg['httpProxy']="xxxxxx.xxxxxx:3128"
> > proxyHost = cfg['httpProxy']
> > if proxyHost[:7] != "http://":
> > proxyHost = "http://%s" % proxyHost
> > os.environ["HTTP_PROXY"] = proxyHost
> >
> > I still didn't understand why I'm loosing config parameters between
> > config.py and rpcServer.py
>
> To configure a proxy, you have options available that go into mrepo.conf.
> See the mrepo-example.conf:
>
> ## Specify the required proxy settings
> #no_proxy = localhost,mrepo,webserver
> #ftp_proxy = http://10.1.2.3:8080
> #http_proxy = http://10.1.2.3:8080
> #https_proxy = http://10.1.2.3:8080
>
> Another way of setting the proxy is by using the environment variables.
> They have the same name as the mrepo.conf directives. However my advice is
> to use the mrepo.conf directives.
>
>
> > So now, rhnget/up2date have access to the redhat server and I'm getting
> that
> > :
> >
> > rhel5-i386: Mirror packages from rhns:///rhel-i386-server-fastrack-5 to
> > /var/ftp/mirror/updates/rhel5-i386/fastrack
> > rhnget: "Unknown error that needs more debugging occured with channel
> > rhel-i386-server-fastrack-5. Skipping.\n'up2date'"
> > mrepo: Mirroring failed for rhns:///rhel-i386-server-fastrack-5 with
> > message:
> > Failed with return code: 256
> >
> > Is this related to the config problem I have ? I don't know....
> > Any idea about that problem ?
>
> Look at the docs/redhat-network.txt. This is a known problem that is
> referenced there (and many times on this mailinglist as well.
>
> Configuring up2date sources
> ---------------------------
> If you encounter the following message:
>
> Traceback (most recent call last):
> File "/usr/bin/mrepo", line 1364, in ?
> main()
> File "/usr/bin/mrepo", line 1247, in main
> mirror(dist.repos[repo], srcdir, dist)
> File "/usr/bin/mrepo", line 819, in mirror
> mirrorrhn(url, path, dist)
> File "/usr/bin/mrepo", line 1099, in mirrorrhn
> package_list, type = rpcServer.doCall(
> repos.listPackages, channel, None, None)
> File "/usr/share/rhn/up2date_client/rpcServer.py", line
> 316, in doCall
> ret = apply(method, args, kwargs)
> File "/usr/share/rhn/up2date_client/repoDirector.py",
> line 21, inlistPackages
> return self.handlers[channel['type']].listPackages(channel,
> msgCallback, progressCallback)
> KeyError: 'up2date'
>
> you need to configure up2date by adding or enabling the following
> line in
> /etc/sysconfig/rhn/sources
>
> up2date default
>
> Especially on a system that wasn't using RHN or on CentOS this is
> a manual
> change you have to make. mrepo doesn't really care, but the
> up2date
> implementation it is using simply requires it.
>
> I may need to change the output as it still references mrepo and that code
> now is in rhnget. But the solution is the same.
>
> These (both) problems are not specific to RHEL5 though, so your battle
> hasn't conquered any new ground as of yet. But I'm very interested
> to see when and where it does ! :)
>
> Kind regards,
> -- dag wieers, dag at wieers.com, http://dag.wieers.com/ --
> [all I want is a warm bed and a kind word and unlimited power]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rpmforge.net/pipermail/tools/attachments/20070514/d119912a/attachment-0001.html
More information about the tools
mailing list