Installation hangs at password prompt

Bug #1528822 reported by Jonas Hagen
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
pam (Ubuntu)
Invalid
Undecided
Unassigned
postgresql-common (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

1) sudo apt-get install postgresql (on a fresh install of Ubuntu 15.10)
2) Give Password as requested for the configuration of postgresql-common package. (Entered password is visible.)
3) Hit Enter -> process hangs (Ctrl+C or +D do not work either).
4) Only option to exit apt-get is to kill it and delete lock files manually.

Full output of apt-get:
  ...@...:...$ sudo apt-get install postgresql-9.4
  Reading package lists... Done
  Building dependency tree
  Reading state information... Done
  The following extra packages will be installed:
    postgresql-common postgresql-contrib-9.4
  Suggested packages:
    oidentd ident-server locales-all libdbd-pg-perl
  The following NEW packages will be installed:
    postgresql-9.4 postgresql-common postgresql-contrib-9.4
  0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
  Need to get 0 B/3'433 kB of archives.
  After this operation, 14.8 MB of additional disk space will be used.
  Do you want to continue? [Y/n] y
  Preconfiguring packages ...
  Selecting previously unselected package postgresql-common.
  (Reading database ... 321682 files and directories currently installed.)
  Preparing to unpack .../postgresql-common_169git1_all.deb ...
  Adding 'diversion of /usr/bin/pg_config to /usr/bin/pg_config.libpq-dev by postgresql-common'
  Unpacking postgresql-common (169git1) ...
  Selecting previously unselected package postgresql-9.4.
  Preparing to unpack .../postgresql-9.4_9.4.5-1_amd64.deb ...
  Unpacking postgresql-9.4 (9.4.5-1) ...
  Selecting previously unselected package postgresql-contrib-9.4.
  Preparing to unpack .../postgresql-contrib-9.4_9.4.5-1_amd64.deb ...
  Unpacking postgresql-contrib-9.4 (9.4.5-1) ...
  Processing triggers for man-db (2.7.4-1) ...
  Processing triggers for ureadahead (0.100.0-19) ...
  Processing triggers for systemd (225-1ubuntu9) ...
  Setting up postgresql-common (169git1) ...
  Password:

The configuration via dpkg of postgresql-common also hangs after "Password:" prompt. The password can be entered, but is visible and after hitting enter, nothing happens. Can be aborted by Ctrl+C.

  $ sudo dpkg --configure -a
  Setting up postgresql-common (169git1) ...
  Password: hallo
  ^CPassword change aborted.
  dpkg: error processing package postgresql-common (--configure):
   subprocess installed post-installation script was interrupted
  dpkg: dependency problems prevent configuration of postgresql-9.4:
   postgresql-9.4 depends on postgresql-common (>= 142~); however:
    Package postgresql-common is not configured yet.

System: Ubuntu 15.10
Package: postgresql-common
Version: 169git1

description: updated
description: updated
description: updated
description: updated
description: updated
summary: - Configuration hangs at password change
+ Configuration hangs at password prompt
summary: - Configuration hangs at password prompt
+ Installation hangs at password prompt
Revision history for this message
Christoph Berg (myon) wrote :

I'd think the problem is somewhere in your PAM setup. For some reason "su" is asking for a password even when running as root:

    su -s /bin/sh postgres -c "test -O /var/lib/postgresql &&
            test -G /var/lib/postgresql" || \
        chown postgres:postgres /var/lib/postgresql

To be sure where it is really asking, add "set -x" to the beginning of /var/lib/dpkg/info/postgresql-common.postinst and do the dpkg --configure -a again.

Christoph Berg (myon)
Changed in postgresql-common (Ubuntu):
status: New → Invalid
Revision history for this message
Jonas Hagen (jonas-hagen3) wrote :

Yes, this was it. Thanks a lot!

Revision history for this message
pravin.chaudhary (pravin-chaudhary-6) wrote :

I am facing this on ubuntu 18.04.

I added "set -x" to the beginning of /var/lib/dpkg/info/postgresql-common.postinst and did the dpkg --configure -a again, as suggested by Christoph. The output is given below, I can't make out anything from that:

$ sudo dpkg --configure -a
Setting up postgresql-common (190) ...
+ set -e
+ [ postgresql-common ]
+ . /usr/share/debconf/confmodule
+ [ ! ]
+ PERL_DL_NONLAZY=1
+ export PERL_DL_NONLAZY
+ [ ]
+ exec /usr/share/debconf/frontend /var/lib/dpkg/info/postgresql-common.postinst configure
+ set -e
+ [ postgresql-common ]
+ . /usr/share/debconf/confmodule
+ [ ! 1 ]
+ [ -z ]
+ exec
+ [ ]
+ exec
+ DEBCONF_REDIR=1
+ export DEBCONF_REDIR
+ SSL_ROOT=/etc/postgresql-common/root.crt
+ [ configure = configure ]
+ [ postgresql-common ]
+ quiet=--quiet
+ getent passwd postgres
+ getent group postgres
+ + id -Gn postgres
grep -qw postgres
+ id -u postgres
+ [ 126 -eq 0 ]
+ id -g postgres
+ [ 129 -eq 0 ]
+ mkdir -p /var/lib/postgresql
+ su -s /bin/sh postgres -c test -O /var/lib/postgresql &&
            test -G /var/lib/postgresql

Revision history for this message
lai (whlai) wrote :

I have the same issue in a new install of 18.04 as @pravin.chaudhary

How do we fix this?

Revision history for this message
Steve Langasek (vorlon) wrote :

As stated previously, if su is blocking prompting for a password when run as root, this is a bug in your pam /config/. It is not a bug in the pam package.

On a default system there is no problem installing postgresql-common.

Changed in pam (Ubuntu):
status: New → Invalid
Revision history for this message
Michel Verbist (michel-verbist) wrote :

I also had a smb mount configured via pam_mount.
I solved this by excluding some users (root and postgres) from the mounting of the volume, like this.

<volume fstype="cifs" server="xxxxx" path="%(USER)" mountpoint="/home/%(USER)/xxxx" options="vers=2.0,credentials=/home/%(USER)/.smbcredentials">
  <and>
    <not>
      <user>root</user>
    </not>
    <not>
      <user>postgres</user>
    </not>
  </and>
</volume>

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.