Opened 14 years ago

Closed 7 months ago

#24180 closed defect (fixed)

postgres: Incorrect home directory created

Reported by: dgonzalez@… Owned by: jyrkiwahlstedt
Priority: Normal Milestone:
Component: ports Version: 1.8.2
Keywords: Cc: ryandesign (Ryan Carsten Schmidt), dweber@…, cooljeanius (Eric Gallager), jenstroeger (Jens Troeger)
Port: postgresql84 postgresql84-server mysql5-server

Description

Installed postgresql84, postgresql84-server, the postgres user created was created with the home directory /opt/local/var/db/postgresql83.

Easily remedied with dscl: change postgres NFSHomeDirectory /opt/local/var/db/postgresql83 /opt/local/var/db/postgresql84

Change History (12)

comment:1 Changed 14 years ago by mf2k (Frank Schima)

Cc: jwa@… added
Keywords: dscl postgresql84 postgresql84-server removed
Owner: changed from macports-tickets@… to mww@…
Port: postgresql84 postgresql84-server added

comment:2 Changed 14 years ago by dweber@…

I found the initdb for postgresql84-server did not work unless postgresql83* was installed. Is this related to this bug?

sudo su postgres -c '/opt/local/lib/postgresql84/bin/initdb -D /opt/local/var/db/postgresql84/defaultdb'

So I have both postgres83-server and postgres84-server installed. So where "should" that NFSHomeDirectory exist?

I found this other ticket interesting too: #17051

Is it possible to create a single 'postgres' user account that can serve all of the postgres??-server ports?

comment:3 Changed 14 years ago by dweber@…

Keywords: postgres user group added
Port: mysql5-server added

This is very helpful: http://www.postgresql.org/docs/8.3/interactive/postgres-user.html

Note there is no specific advice about creating a version specific postgres user. The actual user:group accounts are '_postgres' and only the user account has an alias set to 'postgres'.

(I wonder whether similar user:group rules might apply to mysql5-server?)

comment:4 Changed 13 years ago by jmroot (Joshua Root)

Cc: ryandesign@… added
Summary: Incorrect home directory createdpostgres: Incorrect home directory created

comment:5 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

What are you wondering about mysql5, specifically? The mysql5-server port creates a user "_mysql" (or "mysql" on Tiger); no version number is in the username, and no attempt is made in the port to set that user's home directory to anything in particular, so I don't see how mysql5 is related to this ticket.

comment:6 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: dweber@… added

Cc'ing Darren to whom the above comment was directed.

comment:7 Changed 7 years ago by mf2k (Frank Schima)

Cc: jyrkiwahlstedt removed
Keywords: postgres user group removed
Owner: changed from mww@… to jyrkiwahlstedt
Status: newassigned

comment:8 Changed 6 years ago by jyrkiwahlstedt

Resolution: fixed
Status: assignedclosed

Currently the user created is always postgres. The real name visible at times may differ, but the user doesn't change. The user directory also stays.

comment:9 Changed 6 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: closedreopened

This is still an issue. The home directory of the postgres user is based on the name of the first postgresql*-server port the user (or build server!) installed. For example on my system I don't have the postgresql92-server port installed anymore, but I still have:

$ dscl . -read /Users/postgres NFSHomeDirectory
NFSHomeDirectory: /opt/local/var/db/postgresql92

comment:10 Changed 3 years ago by cooljeanius (Eric Gallager)

Cc: cooljeanius added

comment:11 Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: jenstroeger added

Has duplicate #54693.

comment:12 Changed 7 months ago by dgilman (David Gilman)

Resolution: fixed
Status: reopenedclosed

In d3af627a1b5e66d5a583b217cbf7d7cc79102403/macports-ports (master):

postgresql16-server: new port

Closes: #24180
Closes: #64286

Note: See TracTickets for help on using tickets.