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. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/735341 Title: adduser creates expired system user -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs