To prevent the overhead of administering the second instance, I started investigating an old RPM option I'd never used: --relocate. It turns out this option was the opposite of what I had expected, in that it moved the first instance, rather than install a second. And besides, using RPM manually was only incrementally better than the original idea.
So what about YUM? There is an option for --installroot=/path. Seems like what I wanted: instead of distributing files based on system root to /etc, /usr, /var, lets put the httpd files in an tree under /opt. What happened when I ran the command surprised me:
yum install httpd --installroot=/optThis thing is not going to only install the httpd binaries, libraries, and config files... but every dependency... which already exists on the system! And its going to require 64M of disk space!
<snip>
Transaction Summary
=============================
Install 77 Package(s)
Update 0 Package(s)
Remove 0 Package(s)
Total download size: 64 M
Is this ok [y/N]:
Oh, wait... I've got like 250G of free space. Do I really care if it take 64M? No! And so, I answered "Y". What did we end up with?
ls /optOuch! That's ugly. Looks like the better (cleaner, prettier) choice would have been:
bin dev home lib64 mnt proc sbin srv tmp var
boot etc lib media opt root selinux sys usr
yum install httpd --installroot=/opt/httpd-2iFor the sake of simplicity, through the miracle of virtualization, lets just consider that fixed.
Lets see what we got:
/usr/sbin/httpd -vWhat about an update? I added a repo file to include the updates directory on the satellite server.
Server version: Apache/2.2.8 (Unix)
/opt/httpd2i/usr/sbin/httpd -v
Server version: Apache/2.2.8 (Unix)
yum update -y httpdAs expected for the base install, but no love from the second instance.
<snip>
/usr/sbin/httpd -v
Server version: Apache/2.2.9 (Unix)
/opt/httpd2i/usr/sbin/httpd -v
Server version: Apache/2.2.8 (Unix)
yum update -y httpd --installroot=/opt/httpd2i/Still no good. As a matter of fact, nothing seemed to work. So, as a workaround, I tried this:
Setting up Update Process
No Packages marked for Update
yum install httpd -y --installroot=/opt/httpd2i-2/In a nutshell, create a third instance, and copy the third instance over the second, hoping not to overwrite any configuration files in the process.
rsync -Pr httpd2i-2/* httpd2i/ --update
/opt/httpd2i/usr/sbin/httpd -v
Server version: Apache/2.2.9 (Unix)
rm -rf /opt/httpd2i-2
Does this solve the original problem? Sort of. Is it easier than recompiles? Its faster. Just one more problem... As is, the new Apache does not run. Looks like we need some more hacking. Stay tuned for part 2.
*** Update ***
On second though... I'll just recompile. It turns out there are some references to that path in the RedHat binaries. That's bad form on their part, and they should be ashamed, but by the time I figure out how to hack this, the recompile will be done.
So, no part two. Just snag the binaries and be done with it. That doesn't mean that this feature is useless. It just means that it didn't solve this problem.
No comments:
Post a Comment