FreeBSD Diary

Upgrade 4.2 - 4.5: Makeworld:

We decided to update an older 4.2 server to 4.5 and update a bunch of ports that are out of date and needed to be patched for security reasons.

Here is the summary of what we wanted to accomplish

  1. Make world on my machine to upgrade it from FreeBSD 4.2 - 4.5
  2. Upgraded to PHP 4.1.2 (security fix)
  3. Installed PortVersion
  4. Upgraded several ports - but not all - not yet anyway!

Here is the summary of issues that we ran into:

  1. Could not make install after rebuilding my kernel to upgrade the binaries during make world
  2. SSH no longer worked
  3. mySQL functions missing from latest PHP install
  4. Broke samba
  5. Broke mail and webmail connection

Here is the more detailed list of problems and solutions:

  1. The 4.2 - 4.5 upgrade went pretty well except a few interesting problems:
    1. While doing the make install I had a couple of errors like:

      smmpd group not valid (or not found - can't remember)
      - Cause: different default users and groups from 4.2 - 4.5
      - Solution: looked at master.passwd and groups in /etc/ and compared with /usr/src/etc/
      added the missing users and groups using pw (my pw.conf contains default of nologin and no home dir):
      ie:
      pw groupadd smmpd -g25
      pw useradd smmpd -u25 -g25

    2. SSH no longer allowed login

      - Cause: pam.conf had changed
      - Solution: copy pam.conf from /usr/src/etc/ to /etc/
      - Note: Apparantly 4.2 and 4.3-4.5 used a different pam.conf

  2. Upgrading to PHP4.1.2 was painless except for one minor detail:
    1. MySQL functions were no longer loaded!!!!!

      - Cause: somehow the makefile contained the option without mysql and would not take the value from configure
      - Solution: Edit the makefile manually and change without mysql to with mysql

    2. Also had to update the Zend Optimizer I have installed as it is PHP version dependant (just downloaded and installed)
  3. Portupgrade was pretty easy to use but a little confusing on parts
    1. You must run 'pkgdb -F' first and answer all the questions correctly. It is a little confusing here and I screwed up a little. If in doubt of what to do- SKIP (you can always run this command later
    2. CVSup your ports
    3. Run 'portsdb -Uu' - always run this after cvsup'inig
    4. Run 'portversion | grep "<" ' to find out which ports are out of date
    5. Run 'portupgrade -PR [port_name listed in d] ' to upgrade a single port and all of it's dependencies or

      run 'portupgrade -aPR' to automatically update all out of date ports

    6. Look at the /usr/ports/sysutils/portupgrade/pkg_desc for other commands like portclean, etc
  4. Most of the ports upgraded no problem except for a few exceptions:
    1. Samba installed the devel version

      - Cause: I screwed up during pkgdb -F command
      - Solution: deinstall and install samba.2.2.3a (I think that is the version)

    2. Stable Samba version didn't recognize my password anymore

      - Cause: beats the hell out of me
      - Solution: remove and recreate samba account(s)
      smbpasswd -x username
      smbpasswd -a username

    3. Upgraded cclient which is linked with IMAP and Courier and mail users could no longer log in using Outlook/Express/etc

      - Cause: Courier upgrade caused a change in my password file
      - Solution: change all passwords manually (ya right!) or
      touch /etc/userdb
      chmod 600 /etc/userdb
      masteruserdb (or something like: masterdb)

    4. Upgrade the mysql-client and server and then did a portclean -L which caused webmail to fail

      - Cause: apparantly one of the libmysql????.so.6 is required by my mail installed
      - Solution: copy the backup of .so (thanks portclean for not deleting them!!!) from the /usr/local/lib/compat/ folder to the appropriate location