install failure if user postgres already exists and group postgres is missing
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
postgresql-common (Ubuntu) |
Won't Fix
|
Medium
|
Unassigned |
Bug Description
Binary package hint: postgresql-common
Hi
I was trying to install postgresql-8.2 on an AMD64 bit machine on Ubutnu 7.04. But its broken in the middle of installation. The following is the output:
~# apt-get install postgresql-8.2
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
postgresql-common
Suggested packages:
oidentd ident-server
The following NEW packages will be installed
postgresql-8.2 postgresql-common
0 upgraded, 2 newly installed, 0 to remove and 9 not upgraded.
Need to get 0B/3798kB of archives.
After unpacking 18.6MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Preconfiguring packages ...
Selecting previously deselected package postgresql-common.
(Reading database ... 113340 files and directories currently installed.)
Unpacking postgresql-common (from .../postgresql-
Selecting previously deselected package postgresql-8.2.
Unpacking postgresql-8.2 (from .../postgresql-
Setting up postgresql-common (73) ...
chown: `postgres:
dpkg: error processing postgresql-common (--configure):
subprocess post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of postgresql-8.2:
postgresql-8.2 depends on postgresql-common (>= 63); however:
Package postgresql-common is not configured yet.
dpkg: error processing postgresql-8.2 (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
postgresql-common
postgresql-8.2
E: Sub-process /usr/bin/dpkg returned an error code (1)
Thanks for your valuable time
Changed in postgresql-common: | |
status: | Incomplete → Triaged |
For some useful information:
I am using NIS services for sharing account information. When postinstallation script of postgresql-common is running the following command
"if ! getent passwd postgres > /dev/null"
its giving the wrong information. So the following command is not executing properly
adduser --system --quiet --home /var/lib/postgresql --no-create-home \
--shell /bin/bash --group --gecos "PostgreSQL administrator" postgres
I already had user postgres in the shadowpassword. So the following command is giving the user id which is right
~# id -u postgres
1004
but postgres user is not assign to group postgres. Besically there was no group called postgres. So when postgresql-common installation script is checking for group id its getting wrong value. The following command is not getting the right value
~# id -g postgres
100
These commands are besically giving a totaly wrong output to the postgresql-common installation.
if [ "`id -g postgres`" -eq 0 ]; then
echo "The postgres system user must not have root as primary group.
Please fix this and reinstall this package." >&2
exit 1
fi
Because of that the following command is not executing
` chown postgres:postgres /var/lib/ postgresql`
and giving an error exit status 1 and which stopping the script to execute. As a result the whole installation is breaking down.
My other packages are depend on postgresql-8.2 package. So if it does not installed all other breakdown. So I hope you will do something about it. Possible add something to the script to overcome this situation. I will be very grateful to you if you solve this problem. Thanks