[WBEL-users] Setting up a local WBEL mirror and update area - howto

Will Senn will_senn@comcast.net
Mon, 22 Mar 2004 11:59:29 -0600


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Ewan,<br>
<br>
Thanks for the input, I'll put together a smaller, condensed and
corrected howto in the next day or so and send it. I'm just a
power-user turned experimenter so, I bow to y'alls superior Sys Admin
skills (rpms should be built as regular users - who knew?). Oh and why
are there 2 mount points - ha! I mounted it originally as /whitebox and
only after realizing that symlinks wouldn't work remounted as
/var/ftp/pub/whitebox and then I compounded the error by forgetting it.<br>
<br>
I am primarily using Whitebox to run a cluster and learn about parallel
processing, but also to learn general admin stuff like
nis/ldap/pxeboot/dns/nfs//updates etc. The NIS server was
straightforward enough after the assist, LDAP is still in progress,
PXEBOOT, and NFS were a breeze, updates have been the most difficult,
but only from a number of steps required perspective. DNS was easy once
I realized that it runs chroot - imagine modifying, remodifying and
scratching your head wondering why nothing works when all the time
you're editing the files in the wrong locations...<br>
<br>
Thanks,<br>
<br>
Will<br>
<br>
Ewan Mac Mahon wrote:<br>
<blockquote cite="mid20040321172247.GA7567@york.ac.uk" type="cite">
  <pre wrap="">On Sat, Mar 20, 2004 at 09:15:27PM -0600, Will Senn wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">All,

Nobody asked me for this, but considering the amount of work it was, 
perhaps someone will appreciate a recipe. Please feel free to correct 
anything that isn't accurate or suggest improvements.

    </pre>
  </blockquote>
  <pre wrap=""><!---->Nice, maybe we can get John to put it on the website when he gets back. In the
meantime, however, I have a few suggestions...

&lt;snip&gt;
  </pre>
  <blockquote type="cite">
    <pre wrap="">Updating to rhn-applet-2.1.7

   1. download the updated version of the source RPM, available at:
       
<a class="moz-txt-link-freetext" href="http://people.redhat.com/~veillard/testing/FC1/i386/rhn-applet/2.1.7/rhn-applet-2.1.7-1.src.rpm">http://people.redhat.com/~veillard/testing/FC1/i386/rhn-applet/2.1.7/rhn-applet-2.1.7-1.src.rpm</a>

   2. save the file to  /usr/src/redhat/SRPMS

    </pre>
  </blockquote>
  <pre wrap=""><!---->This assumes that you're going to build the RPM as root, which is
generally considered A Bad Thing(TM). Aside from a few awkward packages
that need root most should be built as an unprivelleged user. It does need
a little setting up, but if I were you I'd just include a pointer to a
guide elsewhere rather than writing my own; there's one at
<a class="moz-txt-link-rfc2396E" href="http://freshrpms.net/docs/fight/">&lt;http://freshrpms.net/docs/fight/&gt;</a> that covers it, amongst other things.



  </pre>
  <blockquote type="cite">
    <pre wrap="">   3. install the sources
      #rpm -ivh /usr/src/redhat/SRPMS/rhn-applet-2.1.7-1.src.rpm

   4. unzip the source
      #cd /usr/src/redhat/SOURCES
      #tar xvzf rhn-applet-2.1.7.tar.gz

    </pre>
  </blockquote>
  <pre wrap=""><!---->More as a matter of style than anything else, I'd have rpm do it for us:
$ rpmbuild -bp SPECS/applet.spec

  </pre>
  <blockquote type="cite">
    <pre wrap="">   5. find and change the occurances of redhat-release to whitebox-release
      #cd rhn-applet-2.1.7
      #grep -n -i redhat-release *
         when run will return line numbers and filenames of any files 
containing the string redhat-release
      #vi +292 rhn_applet_model.py
      #vi +156 rhn_applet_rpc.py

    </pre>
  </blockquote>
  <pre wrap=""><!---->How about (all one line):

for filename in `grep -l redhat-release *` ; do mv -f ${filename} ${filename}.orig ; sed -e "s/redhat-release/whitebox-release/g" &lt; ${filename}.orig &gt; ${filename} ; rm -f ${filename}.orig ; done

which should do it automatically. To be honest though I'd have thought the
correct approach to this would be for John to release a fixed version -
since he's already including a fedora derived version of up2date I
wouldn't have thought that this would be an unacceptable deviation from
RHEL.

  </pre>
  <blockquote type="cite">
    <pre wrap="">   6. backup or delete the downloaded SRPM, we do not need it anymore - 
we are going to create a new, fixed version
      #rm /usr/src/redhat/SRPMS/rhn-applet-2.1.7-1.src.rpm

    </pre>
  </blockquote>
  <pre wrap=""><!---->rpm will just overwrite it with the new one anyway, so this is redundant
(but harmless)

  </pre>
  <blockquote type="cite">
    <pre wrap="">   7. rebuild the SRPM
      #cd /usr/src/redhat/SPECS
      #rpmbuild --ba applet.spec

   8. create the optimized RPM for rhn-applet
      #cd /usr/src/redhat/SRPMS
      #rpmbuild --rebuild --target i686 rhn-applet-2.1.7-1.src.rpm

   9. remove the existing rhn-applet
      #rpm --erase rhn-applet

   10. install the new rhn-applet
      #cd /usr/src/redhat/RPMS/i686
      #rpm -ivh rhn-applet-2.1.7-1.i686.rpm

    </pre>
  </blockquote>
  <pre wrap=""><!---->Umm - wouldn't an upgrade be better than an uninstall/reinstall?

  </pre>
  <blockquote type="cite">
    <pre wrap="">   11. exit the running applet
       If you are in X Windows, right-click on the rhn-applet icon 
(usually a Blue check-mark or Red exclamation-point to the right) and 
select Exit from the pop-up menu.

   12. start the new applet
         click the Foot =&gt; System Tools =&gt; Red Hat Network Alert Icon


Create an area for the updates and base os

   If you have 6+ GB free disk space on a mounted filesystem, you can 
skip down to step XXXX, otherwise, I am going to cover partitioning and 
creating the filesystem from free unallocated space on the hard drive.
    </pre>
  </blockquote>
  <pre wrap=""><!---->&lt;snip&gt;

Again, I'd just point to an external HOWTO, lots of people aren't going to
need this, but that's just a matter of personal taste.
 
  </pre>
  <blockquote type="cite">
    <pre wrap="">   3. create the mount point and ftp directory
         #mkdir /whitebox
         #mkdir /var/ftp/pub/whitebox

   4. create the filesystem for the partition we created above
         #mke2fs -j -L "/whitebox" /dev/hda11

   5. create entries for the /whitebox mountpoint and the ftp directory 
in fstab
         #vi /etc/fstab
            LABEL=/whitebox   /whitebox   ext3   defaults   1   2
            LABEL=/whitebox   /var/ftp/pub/whitebox   ext3   defaults 1
            0

    </pre>
  </blockquote>
  <pre wrap=""><!---->I'm probably missing something here, but why mount it in two places rather
than just under /var/ftp?

  </pre>
  <blockquote type="cite">
    <pre wrap="">   6. mount the filesystem to the 2 mount points
        #mount -a
            or alternatively
       #mount /dev/hda11 /whitebox
       #mount /dev/hda11 /var/ftp/pub/whitebox

   7. add vsftp to the runlevel(s) and start it up
      #chkconfig --level 345 vsftpd on
      #service vsftpd start

    </pre>
  </blockquote>
  <pre wrap=""><!---->A 'chkconfig vsftpd on' will work to turn it on in levels 2, 3, 4 &amp; 5
without the --level parameter.
 
  </pre>
  <blockquote type="cite">
    <pre wrap="">   8. create a directory to hold the base os
      #mkdir /whitebox/os/i386

   9. for each of the original 3 cd's - mount them, copy their contents 
to the base os directory and unmount them
      #mount /mnt/cdrom
      #cp -var /mnt/cdrom/* /whitebox/os/i386
      #umount /mnt/cdrom

   10. use rsync to sync the base os and retrieve the updates
      #rsync --quite --delete --recursive 
mirror.physics.ncsu.edu::whitebox/3.0/en/os /whitebox/
      #rsync --quite --delete --recursive 
mirror.physics.ncsu.edu::whitebox/3.0/en/updates /whitebox/

    </pre>
  </blockquote>
  <pre wrap=""><!---->Typo - that's 'quiet', not 'quite'.
 
  </pre>
  <blockquote type="cite">
    <pre wrap="">   11. create a script for cron to call
      #vi /etc/cron.d/whiteboxupdates
         #!/bin/sh
         rsync --quite --delete --recursive 
mirror.physics.ncsu.edu::whitebox/3.0/en/updates /whitebox/
      #chmod a+x /etc/cron.d/whiteboxupdates

   12. edit the crontab to call the whiteboxupdates script every day at 
4:20am
      #crontab -e
         20   4   * * * /etc/cron.d/whiteboxupdates

    </pre>
  </blockquote>
  <pre wrap=""><!---->Well you could, but just slinging it in /etc/cron.daily is easier.

  </pre>
  <blockquote type="cite">
    <pre wrap="">Modify the yum.conf and up2date sources files to use the new local mirror

    </pre>
  </blockquote>
  <pre wrap=""><!---->&lt;snip&gt;
 
  </pre>
  <blockquote type="cite">
    <pre wrap="">Celebrate

   If the recipe worked, and it should - say yippee and move on to more 
challenging stuff like securing it all...

    </pre>
  </blockquote>
  <pre wrap=""><!---->Just a thought, and I could well be remembering this wrongly, but doesn't
vsftpd default to not allowing anonymous logins? If it does then how to
change it would be a useful thing to add.


Ewan
_______________________________________________
Whitebox-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Whitebox-users@beau.org">Whitebox-users@beau.org</a>
<a class="moz-txt-link-freetext" href="http://beau.org/mailman/listinfo/whitebox-users">http://beau.org/mailman/listinfo/whitebox-users</a>

  </pre>
</blockquote>
</body>
</html>