[Spacewalk-list] rhn_check hangs if no internet access is available

Andy Miller Andy at doneath.fmail.co.uk
Fri Dec 4 10:47:12 UTC 2009


Thanks Jonathan and Colin,

Both solutions work in the longer term, but not during the initial boot.
Custom %post scripts, (with or without nochroot) happen after the
Spacewalk created %post, and the rhn_check is in that section. So
rhn_check hangs for several minutes trying the remote repos.

I've come up with a dirty hack that seems to work.

Looking at the order that Spacewalk 0.6 puts the various %post sections
into the Kickstart. First we have the %post --nochroot section that
contains both the Spacewalk inserted and the user edited sections (in
that order), then there is the Spacewalk %post section, and finally the
user edited %post section.

I created a %post --nochroot script that contains the following lines
%post
rm -f /etc/yum.repos.d/*.repo >> /root/ks-hack.log

Spacewalk addends these to the %post --nochroot section, creating a
third %post section that gets run before the Spacewalk %post section.
The repos get deleted before the rhn_check runs, and it sails through in
0.041 seconds (it tells me) rather than the >10 minutes it took time out
before.

This is a dirty, nasty hack, and I am sure that something will break it
at some point.

Can anyone think of a more robust solution?

Andy


> Date: Thu, 03 Dec 2009 19:59:03 -0500
> From: Jonathan Scott <lists at xistenz.org>
> Subject: Re: [Spacewalk-list] rhn_check hangs if no internet access is
> 	available
> To: spacewalk-list at redhat.com
> Message-ID: <4B185ED7.1020203 at xistenz.org>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> 
> Andy Miller wrote:
> > Hi Folks,
> >
> > I've nearly finished setting up a Spacewalk server to provision CentOS
> > 5.4 (initially). 
> >
> > Machines on the company LAN have limited internet access, they do not
> > have access to remote repositories, only the local Spacewalk server. So
> > in a %post section of my kickstart I have some commands to wipe the
> > default repos from /etc/yum.repos.d.
> >
> > However, Spacewalk is inserting a call to rhn_check into the Kickstart
> > that gets run before my %post section, so the repos are still there and
> > the command hangs for a goodly while trying to see if the default
> > repositories are faster than the local Spacewalk server. It gives up
> > eventually, but the pause is unacceptably long.
> >
> > Any suggestions on how I can either 
> > * wipe /etc/yum.repos.d before rhn_check is run
> > * stop the .repo files from being copied down in the first place
> > * stop rhn_check running (I don't believe it is vital at this point, I
> > can add to my %post section if it is?)
> > * otherwise stop the command from hanging around?
> >
> > Many thanks
> >
> > Andy
> >   
> 
> Since I pull down everything into local channels and use the 
> yum-rhn-plugin, I just drop the following in my /etc/yum.conf during my 
> %post:
> 
> reposdir=
> 
> seems to do the trick, lasts through full system updates/upgrades. 
> The .repo files are still there, they get overwritten when I update the 
> server, but they're never checked because of that reposdir setting, just 
> the rhn-plugin.
> 
> - Jonathan
> 




More information about the Spacewalk-list mailing list