adduser creates expired system user

Bug #735341 reported by Petri Lehtinen
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
shadow (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: postgresql-common

This is the error message:

Setting up postgresql-common (106ubuntu1) ...
Your account has expired; please contact your system administrator
chfn: PAM authentication failed
adduser: `/usr/bin/chfn -f PostgreSQL administrator postgres' returned error code 1. Exiting.
dpkg: error processing postgresql-common (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of postgresql-8.4:
 postgresql-8.4 depends on postgresql-common (>= 104~); however:
  Package postgresql-common is not configured yet.
dpkg: error processing postgresql-8.4 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of postgresql:
 postgresql depends on postgresql-8.4; however:
  Package postgresql-8.4 is not configured yet.
dpkg: error processing postgresql (--configure):
 dependency problems - leaving unconfigured

I've seen this before. May not be postgresql-specific.

ProblemType: Package
DistroRelease: Ubuntu 10.04
Package: postgresql-common 106ubuntu1
ProcVersionSignature: Ubuntu 2.6.32-29.58-generic-pae 2.6.32.28+drm33.13
Uname: Linux 2.6.32-29-generic-pae i686
Architecture: i386
Date: Tue Mar 15 10:02:59 2011
ErrorMessage: subprocess installed post-installation script returned error exit status 1
PackageArchitecture: all
SourcePackage: postgresql-common
Title: package postgresql-common 106ubuntu1 failed to install/upgrade: subprocess installed post-installation script returned error exit status 1

Revision history for this message
Petri Lehtinen (petri) wrote :
Revision history for this message
Martin Pitt (pitti) wrote :

"Your account has expired; please contact your system administrator chfn: PAM authentication failed"

Looks like you changed the local system "postgres" user to have an expired account. That doesn't happen in the default setup, so I assume this is a local change?

Changed in postgresql-common (Ubuntu):
status: New → Invalid
Revision history for this message
Petri Lehtinen (petri) wrote :

No. My system didn't have the "postgres" user before installation. I can reproduce this problem like this:

    apt-get purge --auto-remove postgresql*; deluser postgres; apt-get install postgresql

The error message is exactly the same. Invoking apt-get -f install finishes the installation properly.

Changed in postgresql-common (Ubuntu):
status: Invalid → New
Revision history for this message
Martin Pitt (pitti) wrote :

Can you please give me the output of

  sudo passwd -S postgres
  grep postgres /etc/passwd

after installation, and the following command as well?

  sudo adduser --debug --system systest

After this, please do

  sudo deluser --remove-home systest

to clean up again.

affects: postgresql-common (Ubuntu) → shadow (Ubuntu)
Changed in shadow (Ubuntu):
status: New → Incomplete
summary: - package postgresql-common 106ubuntu1 failed to install/upgrade:
- subprocess installed post-installation script returned error exit status
- 1
+ adduser creates expired system user
Revision history for this message
Petri Lehtinen (petri) wrote :

Right after the installation has failed:

$ sudo passwd -S postgres
postgres L 03/15/2011 0 99999 7 -1

$ grep postgres /etc/passwd
postgres:x:113:130::/var/lib/postgresql:/bin/bash

$ sudo adduser --debug --system systest
Selecting UID from range 100 to 999 ...
Adding system user `systest' (UID 129) ...
Adding new user `systest' (UID 129) with group `nogroup' ...
/usr/sbin/useradd -d /home/systest -g nogroup -s /bin/false -u 129 systest
/usr/sbin/usermod -p * systest
/usr/bin/chage -M 99999 systest
Creating home directory `/home/systest' ...

$ sudo deluser --remove-home systest
Looking for files to backup/remove ...
Removing files ...
Removing user `systest' ...
Warning: group `nogroup' has no more members.
Done.

Revision history for this message
Martin Pitt (pitti) wrote :

Hm, this all looks fine. I never saw this before, can't reproduce, and have no other explanation what's wrong with your system then, I'm afraid. Setting back to New, and assigning to adduser.

affects: shadow (Ubuntu) → adduser (Ubuntu)
Changed in adduser (Ubuntu):
status: Incomplete → New
Revision history for this message
Petri Lehtinen (petri) wrote :

I had a look at postgresql-common's postinst, and tried to invoke the same command it uses to add the user (just changed the user name):

$ sudo adduser --system --quiet --home /var/lib/postgresql --no-create-home --shell /bin/bash --group --gecos "PostgreSQL administrator" testuser
Your account has expired; please contact your system administrator
chfn: PAM authentication failed
adduser: `/usr/bin/chfn -f PostgreSQL administrator testuser' returned error code 1. Exiting.

If I remove the --gecos option, it works fine:

$ sudo adduser --system --quiet --home /var/lib/postgresql --no-create-home --shell /bin/bash --group testuser
$ echo $?
0

If I run the chfn command manually, it fails:

$ sudo /usr/bin/chfn -f "PostgreSQL administrator" testuser
Your account has expired; please contact your system administrator
chfn: PAM authentication failed

So I think this might be a problem in passwd rather than adduser.

Petri Lehtinen (petri)
affects: adduser (Ubuntu) → shadow (Ubuntu)
Revision history for this message
Petri Lehtinen (petri) wrote :

For some reason, my root user account was expired. After running "sudo chage -E -1 root", everything works again.

Changed in shadow (Ubuntu):
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.