Bug 14734

Summary: 5b1: user postgres: directory /var/lib/pgsql does not exist
Product: Mageia Reporter: Bit Twister <bittwister2>
Component: RPM PackagesAssignee: Mageia Bug Squad <bugsquad>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: Normal CC: cjw
Version: CauldronKeywords: NEEDINFO
Target Milestone: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Source RPM: postgresql CVE:
Status comment:

Description Bit Twister 2014-12-05 17:22:56 CET
Description of problem:

# pwck -r
user 'postgres': directory '/var/lib/pgsql' does not exist

Version-Release number of selected component (if applicable):


How reproducible: Always


Steps to Reproduce:
Clean install of Mageia-5-beta1-x86_64-DVD.iso. Default runlevel: 3
Package Group Selection screen has all package groups selected except
Other Graphical Desktops. non-free and tainted media are enabled.
Followed with:
remove-unused-packages
urpmi --downloader wget --auto --auto-update
urpme --auto-orphans and reboot. 

1. click up a terminal, I use xterm
2. su - root
3. pwck -r

Workaround:   mkdir -p /var/lib/pgsql

Reproducible: 

Steps to Reproduce:
Comment 1 David Walser 2014-12-05 19:02:25 CET
This has nothing to do with postgresql-jdbc, which is a java package.

Is it really necessary that all system accounts' home directories actually exist?

Keywords: (none) => NEEDINFO
Hardware: x86_64 => All
Source RPM: postgresql-jdbc-9.3.1102-5.mga5 => postgresql

Comment 2 Bit Twister 2014-12-05 19:26:01 CET
(In reply to David Walser from comment #1)

> Is it really necessary that all system accounts' home directories actually
> exist?

Well, it is nice when you can check for possible errors without having to ignore those who do not have an actual "home directory".

To answer your question, a quick check would suggest a few don't.
$ grep -c ":/:" /etc/passwd
9
Comment 3 Bit Twister 2014-12-05 22:30:00 CET
(In reply to David Walser from comment #1)
> This has nothing to do with postgresql-jdbc, which is a java package.

Hmm, the "problem" was not there or show up until postgresql-jdbc was installed, I think. I know it was not was not there after install.


Workaround update:
   mkdir -p /var/lib/pgsql
   chown postgres:postgres /var/lib/pgsql
Comment 4 Christiaan Welvaart 2014-12-11 12:47:31 CET
AFAICT postgresql-jdbc does not create this user, only postgresql9.x-server does so. This is a common problem in Mageia: many packages create a user account but the account is not removed when the package is uninstalled. On my system pwck -r gives 11 'missing' home dirs. The solution for you is probably to remove that user account. Creating dummy home dirs does not make a lot of sense.

CC: (none) => cjw

Comment 5 Bit Twister 2014-12-11 13:19:43 CET
(In reply to Christiaan Welvaart from comment #4)
> This is a common problem in Mageia: many packages create a user
> account but the account is not removed when the package is uninstalled.

Not too worried about when package is uninstalled, but would be nice unless taskobsolete is removing the package.

> On my system pwck -r gives 11 'missing' home dirs. 

That bites. my Mageia-5-beta1-x86_64-DVD clean install with all package groups and kde/gnome has
pwck -r
user 'adm': directory '/var/adm' does not exist
user 'news': directory '/var/spool/news' does not exist
user 'uucp': directory '/var/spool/uucp' does not exist


> The solution for you is probably to remove that user account. 
> Creating dummy home dirs does not make a lot of sense.

If the application does not need one, I completely agree.
Install should create one if required, else set home as /. For examples run:
  grep :/: /etc/passwd
Comment 6 Christiaan Welvaart 2014-12-11 14:31:41 CET
The postgres user is created and used by postgresql9.x-server but apparently you don't have that package installed. How the account was created is still a mystery. Did you remove a postgresql server package at some point?

$ rpm -qf /var/lib/pgsql
postgresql9.3-server-9.3.5-3.1.mga5

Status: NEW => RESOLVED
Resolution: (none) => WONTFIX

Comment 7 Bit Twister 2014-12-11 15:48:37 CET
(In reply to Christiaan Welvaart from comment #6)
> The postgres user is created and used by postgresql9.x-server but apparently
> you don't have that package installed.

grep postgr /root/install/* would suggest it was there. 
It only showed up in my install_toys log.

              #**************************************************************
              #*    installing 36/55 flightgear
              #**************************************************************
The following packages have to be removed for others to be upgraded:
lib64pq9.3_5.6-9.3.5-3.mga5.x86_64
 (due to conflicts with postgresql-libs[< 9.3.5-3.mga5])
postgresql9.3-9.3.5-3.mga5.x86_64
 (due to missing libpq.so.5.6()(64bit))
postgresql9.3-plpgsql-9.3.5-3.mga5.x86_64
 (due to unsatisfied postgresql-server-ABI()(64bit) == 9.3,
  due to unsatisfied postgresql9.3-server == 9.3.5)
postgresql9.3-server-9.3.5-3.mga5.x86_64
 (due to missing libpq.so.5.6()(64bit),
  due to unsatisfied lib64pq9.3_5.6 >= 9.3.5-3.mga5,
  due to unsatisfied postgresql-plpgsql == 9.3.5-3.mga5)

> How the account was created is still
> a mystery. Did you remove a postgresql server package at some point?

Not on purpose. All install/changes are done by scripts.
None of my scripts remove it.
Comment 8 Christiaan Welvaart 2014-12-11 15:56:26 CET
Thanks, maybe something is wrong in the postgresql conflicts/provides/... . With the postgresql9.4 introduction I tried to follow the same procedure as was used earlier. Now I should probably create a mageia 4 chroot and do some upgrade tests /o\.

What provides postgresql-libs on this system?
Comment 9 Bit Twister 2014-12-11 16:04:42 CET
(In reply to Christiaan Welvaart from comment #8)
> Thanks, maybe something is wrong in the postgresql conflicts/provides/... .
> With the postgresql9.4 introduction I tried to follow the same procedure as
> was used earlier. Now I should probably create a mageia 4 chroot and do some
> upgrade tests /o\.


Pretty sure Mageia 4 is not going to help.
Problem did not exist on 4 or I would have opened a bug report on 4. :)

Problem only showed up on release 5 beta 1.
Comment 10 Christiaan Welvaart 2014-12-11 16:17:51 CET
(In reply to Bit Twister from comment #9)
> Pretty sure Mageia 4 is not going to help.
> Problem did not exist on 4 or I would have opened a bug report on 4. :)
> 
> Problem only showed up on release 5 beta 1.

Right, here is the problem:
flightgear depends on openscengraph, 
openscenegraph: Depends: libgdal.so.1()(64bit)
and lib64gdal1 is compiled against the postgresql9.2 library (lib64pq9.2_5.5) while it should use the latest (9.4).

At the same time the postgresql-libs < x conflict in postgresql9.3 is either too strict or not really needed AFAICT.
Comment 11 Christiaan Welvaart 2014-12-11 17:21:49 CET
The conflict between flightgear and postgresql9.3-server should be fixed with gdal-1.9.2-16.mga5 .