Robin Bowes wrote:
seth vidal wrote:
> On Mon, 2008-10-27 at 21:36 +0000, Robin Bowes wrote:
>> Chris O'Regan wrote:
>>>> I want to know how best to make it available *without* doing that.
>>> You can drop it on a web server somewhere and wget the file.
>> Hmmm, a possibility; is wget guaranteed to be available in the kickstart
>> environment?
> no but urlgrabber is there - it has to be for yum to work.
Ah, OK. That will work.
So, I can put initool on the cobbler server, e.g. in
http://example.com/cobbler/tools/ (yes, I created the "tools" directory)
then create a cobbler snippet:
urlgrabber
http://cobbler.example.com/cobbler/tools/initool /tmp/initool
chmod +x /tmp/initool
initool will then be available for use by the rest of the kickstart script.
Hmmm, or so one would think...
For some reason, this is not working.
I've put the initool script elsewhere on the cobbler server, and have
switched to use wget, so my %pre snippet looks like this:
# Copy initool to use in post
echo "in tools_pre" > /root/tools_pre
wget "http://dist.robinbowes.com/tools/initool" -O /usr/bin/initool
chmod +x /usr/bin/initool
Then, in %post, I have these blocks of code (both loaded from snippets):
# disable repos that are mirrored by cobbler
/usr/bin/initool --file /etc/yum.repos.d/CentOS-Base.repo --section all
--option enabled=0
/usr/bin/initool --file /etc/yum.repos.d/epel.repo --section all
--option enabled=0
/usr/bin/initool --file /etc/yum.repos.d/epel-testing.repo --section all
--option enabled=0
/usr/bin/initool --file /etc/yum.repos.d/rpmforge.repo --section all
--option enabled=0
# set repo priority
/usr/bin/initool --file /etc/yum.repos.d/cobbler-config.repo --section
core-0 --option priority=1
/usr/bin/initool --file /etc/yum.repos.d/cobbler-config.repo --section
CentOS-5-x86_64-Updates --option priority=10
/usr/bin/initool --file /etc/yum.repos.d/cobbler-config.repo --section
RPMForge-RHEL5-x86_64 --option priority=99
/usr/bin/initool --file /etc/yum.repos.d/cobbler-config.repo --section
epel-5-x86_64 --option priority=20
Neither of these blocks of code works - the repo files are not changed.
initool does not exist in /usr/bin, and /root/tools_pre does not exist.
In a flash of inspiration (!) I moved the snippet that copies the
initool script into %post, cunningly changing "pre" to "post" in the
process:
# Copy initool to use in post
echo "in tools_post" > /root/tools_post
urlgrabber
http://dist.robinbowes.com/tools/initool /usr/bin/initool
chmod +x /usr/bin/initool
This now works!
Anyone got any idea why it didn't work in %pre?
R.