Nav Bar Development SME Server on Centos Base SMEonCentos HowTo


Revision Information

If you want to see previous versions of this document use this link

NB: As an easy alternative to the stuff below, please download and install the latest .iso (V7.3a - as of 3rd March 2005 anyhow) from: http://www.ibiblio.org/pub/linux/distributions/e-smith/devel/isos/


Author: Greg Zartman <greg@leiinc.com>
Contributor(s): Charlie Brady, Shad Lords
License: GPL
Last Updated: Nov. 8, 2004

Summary: This document outlines a procedure for migrating SME Server 6.0.1 to a Centros 3.3 base. This included updating all stock Redhat 7.3 rpms to their Centos 3.3 equivalents.

Step 1: Start with a fresh install of SME 6.0.1. This is critical as running this process on a customized machine could produce unexpected results.

Step 2: Download and install the following rpms to your SME 6.0.1 box:

Step 3: Open the config file /etc/yum.conf in pico and insert the following:

[main]
cachedir=/var/cache/yum.centos
debuglevel=2
logfile=/var/log/yum.centos.log
pkgpolicy=last
#exactarch=1
#exclude=kernel*

[1base]
name=Centos 3.3 base
baseurl=http://mirror.centos.org/centos-3/3.3/os/i386/

[2updates]
name=Centos 3.3 updates
baseurl=http://mirror.centos.org/centos-3/3.3/updates/i386/

[3mitel]
name=Mitel SME Base
baseurl=http://www.ibiblio.org/pub/linux/distributions/e-smith/contrib/CharlieBrady/yum-repository/centos-based/


(Or download this copy of yum.conf (updated version of the above):
http://www.ibiblio.org/pub/linux/distributions/e-smith/contrib/CharlieBrady/yum-repository/centos-based/yum.conf
...and copy it to /etc/yum.conf

Step 4: I found that it was necessary to update to yum 2.x because with pkgpolicy=last set using yum 1.x it would not find the newest package if there were two versions of the same package in the same repository.

You can do that with:

Then it is probably a good idea to rebuild/clean out the rpm/yum databases:

And maybe upgrade the kernel separatly from everything else:


Step 5:There is a bug in yum that makes it necessary to remove a couple packages before a global 'yum upgrade' will work - (they will be re-installed in a second) - try this:

Step 6: Issue the following commands at the shell:

Step 7: As the systems comes back up, take note of any breakage and start fixing. :)

If you do fix something - make a note of it here or join the devinfo mailing list and post a comment there.


SME on Centos Base - System Tarball 1

Author: SAAS <saas AT users DOT sf DOT net>
Contributor(s): Charlie Brady, Shad Lords, Greg Zartman, Roger Buck
License: GPL
Last Updated: Dec. 23, 2004

What: A tarball for easy upgrade from SME to Centos 3.3 base

This stuff is offered in the hope that it will help provide some additional momentum towards a Centos 3.3 base for SME Server.

This is NOT a complete upgrade, and hardly anything has been tested. On the other hand, more than 90% of packages have been upgraded - perl 5.8 and related packages are the one significant exception (newt, slang, perl 5.8, and/or related e-smith modules seem to be incompatible with SME-6.0.1-01 server-manager on Centos-3.3).

Most people will ignore the next section and go straight to the 'QUICK START TARBALL INSTALL' (below).

SOME COMMENTS ABOUT UPGRADING WITH YUM

The inquisitive user may care to read the following stuff about yum upgrade used to create the sme-centos-01.tar.gz that may be downloaded from link at bottom of this page.

To finalise the upgrade to 100%, you could simply install the sme-centos-01.tar.gz tarball and then do a simple 'yum upgrade'... but this will almost certainly break server-mamager and the admin console. To avoid upgrade surprises, it'd best to only upgrade selected packages one or two at a time - so that you can easily backout if you break something.

Some cosmetic changes have been made for testing and identity purposes only (to test correct operation of server-manager, /sbin/e-smith/config and imessage in /etc/motd)

Before using yum for any reason, please first check / edit the paths and exclusions in /etc/yum.conf

NO attempt has been made to manually update/customise/modify e-smith templates and/or configuration files.

In summary, the results of this process should make things easiser for anyone who wants to work with the new Centos base but does not want to spend a lot of time on the yum upgrade path!

About the yum upgrade procedure used for tarball creation:
1. Installed SME Server 6.0.1-01 from ISO

2. Installed rpm-python and yum found here (do not use the version of yum taken from fedora legacy):

After much trial and error, the final yum.conf looked something like this:

[main]
cachedir=/var/cache/yum
debuglevel=2
logfile=/var/log/yum.centos.log
pkgpolicy=last
exclude=initscr* kudzu* newt* perl* slang*
#exactarch=1
#exclude=kernel*

[1base]
name=Centos 3.3 base
baseurl=http://mirror.centos.org/centos-3/3.3/os/i386/

[2updates]
name=Centos 3.3 updates
baseurl=http://mirror.centos.org/centos-3/3.3/updates/i386/

[3addons]
name=Centos 3.3 addons
baseurl=http://mirror.centos.org/centos-3/3.3/addons/i386/

[4extras]
name=Centos 3.3 extras
baseurl=http://mirror.centos.org/centos-3/3.3/extras/i386/

[5mitel]
name=Mitel SME base
baseurl=http://www.ibiblio.org/pub/linux/distributions/e-smith/contrib/CharlieBrady/yum-repository/centos-based/

NOTE: You still need to manually remove some conflicting pacakages as described below.

3. Backed up everything.

4. Supplied LOTS of room for /var/cache - 400Meg to 1Gig (depending on how much stuff you have)

5. Ran 'yum list perl' (or similar) to get a list of all headers:yum list perl

6. yum update yum (to update 'yum' itself)

7. yum upgrade kernel* Upgrade to Centos-3.3 kernel(s) - it is best to retain old kernels in case you need to re-boot your server part way through the upgrade process. I delete the old kernels once everything is up and running on the new kernel(s)

NOTE: One problem after a package upgrade, you may end up with multiple installed rpm's of mone or more package(s).

This can also occur when an rpm is already installed and a newer version is installed without using the rmp -U upgrade switch. Sometime's rpm will complain when you do this, and sometimes it will simply install the new rpm without removing the other. The same effect occurs when yum upgrades one or more packages but fails to remove the old package as a result of failure or incompatibility.

This problem is does NOT apply to kernels - you can have as many kernel rpm's installed as you like, and yum will not care. This may also occur if yum fails part-way during an install due to package incompatibility or similar problem. You can literally end up with hundreds of duplicate rpms following a broken yum upgrade!

The difference between a yum update and a yum upgrade, is that an update is supposed to 'replace' an old package, with the new package of the same name. An upgrade will look through the available packages, and if there are any packages that seem like they have changed names, or obsolete a package, it will replace the old package, with the package of the new name. You don't always want that because sometimes there are two packages that provide the same service or programs. An example of this is ssh and openssh. For a slightly different perspective on this, see: https://lists.dulug.duke.edu/pipermail/yum/2004-January/003515.html

To remove multiple versions of the same package, using pine as an example:

1. What instances have been installed?

2. Remove the offending package:

and you should see a message about "pine" specifies multiple packages installed - and rpm should have removed the oldest duplicate package (you will need to check this as rpm sometimes removes a newer package in error)

We also did:

and then manually scanned the list and removed all duplicate/unwanted versions of installed rpm's

To optionally remove all instances of a package-name:

If all your copies of a package disappeared, we simply re-installed using yum:

Note: This would be better if done after the yum upgrade to Centos. Otherwise, yum may want to include a lot of the newer rpm's. This isn't bad in itself, but you might as well upgrade all in one go, and then install the extra packages individually later.

We found that yum often hangs during an SME6 to Centos upgrade... ps ax | grep yum and a simple 'kill pid' command doesn't restore control - you have to do a 'kill -9 pid'. This seems to occur when yum is unable to delet an old pacakage or overwrite a symlink. Removing the old package (rpm -e oldpackagename) and then re-running yum will usually work. It is possible this problem is caused by a stale rpm lock file problem - you may care to try rm -rf /var/lib/rpm/__db and/or rpm -e openldap*", rpm -e e-smith-dynamicdns-* and/or rpm -e strace

Catch 22: You may need strace if you want to troubleshoot yum/rpm problems.

Also, we did:

We had to specify do all of above (and probably others) to avoid 'provides' errors.

Doing a:

will upgrade pakages including kernel, vixie-cron, pam, hwdata and SysVinit?.

To avaid conflicts, we sometimes found it necessary to remove openssh rpm's:

as usual, taking care to keep track of the pacakages that you remove as you go.

WARNING 1. If you are logged in via ssh, this can be a little nerve racking, because you have just removed the program you are logged in with. Rest assured that you will still be connected. Just don't log out until you have re-installed openssh.

WARNING 2. Before you re-boot during/after a kernel upgrade: check, edit and re-run lilo to make sure you load the correct kernel on next boot.

After attempting many upgrade methods, we chose to selectively, manually upgrade packages alaphabetically:

Doing 'a bit at a time' makes it easier to isolate problem dependencies without breaking the upgrade as a whole.

The following 'leftover package list' e*, k*, m*, n*, p* and s* where yum upgrade resulted in problems.

I manually upgraded as many rpm packages as possible to complete the upgrade of the 'leftover package list'... especially excluding perl 5.8 and related packages (which I found to break server-manager)

To upgrade 'leftover packages' we did this:

Then did something similar (not literally) to:

The result is a partial (more than 90% of packages) upgrade from SME-6.0.1-01 to Centos-3.3 excluding Perl5.8 and related modules/pcakages/dependencies.


QUICK START TARBALL INSTALL

The idea here is to use an existing linux box to:

  1. Manually create three ide hdd disk partitions on a dedicated IDE HDD and then:
  2. Copy and expand the tarball to the new ext3 partition.
  3. First-time boot from DOS and using loadlin (run lilo after the first successful boot to the new system).

The three suggested disk partitions are:

  1. A 16M vfat DOS partition (hdx1)
  2. a 6G or larger ext3 root partition (hdx2)
  3. a 256M or larger swap partition (hdx3)

The suggested procedure is:
1. Use the DOS fdisk utility (I used Win98SE fdisk), to partition a secondary IDE disk with a small primary DOS (vfat) partition (say hdc1 16M).

Use fdisk menu to make the DOS partition 'Active' - Due to DOS limitatitions, you may not be able to make the partition active until you boot this as a primary disk - using a fdd to access the new ide hdd partition - dos users should know what I mean :) Re-boot from fdd if necessary and do a fdisk/mbr to flush any old bootloader settings from the mbr. Format the small DOS partition and make it bootable

  • format d: /s

(assuming it is the first partition on the second IDE disk).

2. Attach the new disk (with the newly created DOS partition) to an existing linux box so that you can prepare the new disk to accept the tarball:
>

Boot to your day-to-day linux box using your normal SME or other linux distro installed on your primary disk (say hda) and your new SME disk still connected as above (so that it will appear as hdc or whatever).

3. Login to your day-to-day linux box as root, and then run linux fdisk to create a ext3 partition of 6G or greater on the secondary IDE (say /dev/hdc2 6000M )

4. Create a swap partiton on the seconday (say /dev/hdc3 256M type 82).

5. Re-boot and then format the linux partitions: 'mkfs -j /dev/hdc2' and 'mkswap /dev/hdc3'

6. Mount the new root partition (where you will copy and expand thesme-centos-01.tar.gz tarball) at some convenient mount-point: for example, 'mount /dev/hdc2 /mnt/disk2'

7. Download the SME2Centos tarball to the root level of the partition that will be the root partition (/mt/disk2 in examples above)

8 Change direcories into this partition 'cd /dev/hdc2' and extract archive 'tar zxvf sme-centos-01.tar.gz'

9. Mount the DOS partition (/dev/hdc1 for example) and copy the contents of /mnt/disk2/msdos/* into the DOS boot partition
  • mount /dev/hdc1 -t vfat /mnt/disk1
  • cp -r /mnt/disk2/msdos /mnt/disk1

10. If necessary, edit the boot partition information in the 'linux.bat' file - found in the DOS partition

10. View and if necessary edit the mount points in the '/mnt/disk2/etc/fstab' file.

11. Shutdown and move the newly configured disk to the primary IDE channel so that it boots to the small DOS partition.

12. The new SME-Centos kernel should boot automatically (courtesy of 'loadlin'). If not, then simply boot to the c: drive using a DOS floppy and run c:\linux.bat from the dos command-line. This will load the kernel and mount the root partition specified in linux.bat (default: /dev/hda2).

13. Boot and login as username admin with password admin to customise your server configuration:

username: admin
password: admin

Default Tarball System Configuration

    NIC is RTL8139
    Networking Parameters
    Server Mode serveronly
    Local IP address / subnet mask 192.168.0.21/255.255.254.0
    Gateway 192.168.0.1
    Additional local networks 192.168.0.0/255.255.254.0
    DHCP server disabled
    Server names
    DNS server 192.168.0.21
    Web server www.anyvalidip.com
    Proxy server proxy.anyvalidip.com:3128
    FTP server ftp.anyvalidip.com
    SMTP, POP, and IMAP mail servers mail.anyvalidip.com
    Domain information
    Primary domain anyvalidip.com
    Virtual domains anyvalidip.com
    Primary web site http://www.anyvalidip.com
    Server manager http://mail/server-manager/
    User password panel http://mail/user-password/
    Email Addresses useraccount@anyvalidip.com
    firstname.lastname@anyvalidip.com
    firstname_lastname@anyvalidip.com

For a list of all installed rpms (rpm -qa | sort > installed.rpms.txt), view the file /installed-rpms.txt

I am hoping that anyone likely to find this stuff useful will know how to install it 'as is' - but that it is not sufficiently useful as to justify creation of an .iso

The sme-centos-01.tar.gz file is currently being uploaded to contribs.org (23 Dec 2004).

Click here to download sme-centos-01.tar.gz


What are the Expected results with this upgrade?
I installed on dual P11 with scsi
Server only
1. httpd-admin failed with errors

2. squid failed to load

3 samba working in default setup


4. httpd worked
5. No e-smith manager :-( I could go on.. But is this the sort of thing to expect?

Robert Slater