Login broke after upgrade; how to fix it?

I have recently completed an upgrade of a FreeBSD server than had been running FreeBSD 6.2-RELEASE. I began the update process after the system hard drive (data is on a separate array) and a network card failed. These were the steps that I used on the amd64 system:

1. Source upgraded from 6.2 to 6.4
2. Upgraded from 6.4 to 7.2-RELEASE using the 7.2-RELEASE CD1 image I already had in the office
3. Dropped into single user mode, ran cvsup for the ports collection
4. Tried to run portupgrade -af in batch mode and received lots of errors about the pkdb (fiddled with pkgdb -F and pkgdb --auto-fix for a while)
5. Finally got portupgrade -af to rebuild the ports
6. Rebooted into normal mode and found that the software ran fine
7. Ran freebsd-update fetch && freebsd-update install to move to 7.2-RELEASE-p2

This is where things got ugly. Suddenly, logins started failing for all users. I had to drop into single user mode to trouble-shoot. In single user mode, I tried to su to a user and received this error:

login_getclass: unknown class 'default'
login_getclass: no default/fallback class 'default'
pam_acct_mgmt: error in service module

I inspected the various login configuration files (particularly login.conf), but nothing seemed out of place. Attempting to run "cap_mkdb /etc/login.conf" failed. I was about to revert the build thinking something must have gone wrong, but I copied login.conf and login.access from a backup back into /etc/ and ran cap_mkdb /etc/login.conf" once more. After this, users were able to authenticate again and the system is working.

I am not sure how login.conf became mangled during the update process. Visually inspecting the file did not show any obvious errors, but I have never edited login.conf before.

I hope that this post will help to document a possible solution should someone else ever experience the same login_getclass errors.
 
I ran mergemaster after the source upgrade. I did not run mergemaster after the freebsd-update upgrade.
 
Back
Top