Opened 12 years ago

Closed 12 years ago

#33497 closed defect (fixed)

postgresql*-server: chown: postgres: Invalid argument

Reported by: thehiddendepth@… Owned by: mww@…
Priority: Normal Milestone:
Component: ports Version: 2.0.4
Keywords: haspatch Cc: jyrkiwahlstedt, drkp (Dan Ports)
Port: postgresql91-server postgresql83-server

Description

When install postgresql83-server and postgresql90-server on Mac OS X 10.7.2, I have the following error:

Error: Target org.macports.destroot returned: shell command failed (see log for details)

And in the log file:

:debug:destroot Can't run destroot under sudo without elevated privileges (due to mtree).

Attachments (3)

main.log (14.7 KB) - added by thehiddendepth@… 12 years ago.
postgresql90-server-main.log
main.2.log (14.0 KB) - added by thehiddendepth@… 12 years ago.
postgresql83-server-main.log
postgresql91-server.patch (1.1 KB) - added by drkp (Dan Ports) 12 years ago.

Download all attachments as: .zip

Change History (10)

Changed 12 years ago by thehiddendepth@…

Attachment: main.log added

postgresql90-server-main.log

Changed 12 years ago by thehiddendepth@…

Attachment: main.2.log added

postgresql83-server-main.log

comment:1 Changed 12 years ago by thehiddendepth@…

Cc: thehiddendepth@… added

Cc Me!

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

Cc: jwa@… added; thehiddendepth@… removed
Keywords: destroot postgresql83-server removed
Owner: changed from macports-tickets@… to mww@…
Port: install removed
Summary: :debug:destroot Can't run destroot under sudo without elevated privileges (due to mtree).postgresql*-server: chown: postgres: Invalid argument

The real error shown in both logs is:

chown: postgres: Invalid argument

Is there something wrong with the "postgres" user that these ports should have created? Does the user even exist?

comment:3 in reply to:  2 Changed 12 years ago by thehiddendepth@…

Replying to ryandesign@…:

The real error shown in both logs is:

chown: postgres: Invalid argument

Is there something wrong with the "postgres" user that these ports should have created? Does the user even exist?

Hi, ryan,

thanks for the help. I am not sure if you are asking me. I checked on my MBP, there's no user: postgres created, but there's a group 'postgres' created.

Best Regards. Larry

comment:4 Changed 12 years ago by drkp (Dan Ports)

Cc: dports@… added
Keywords: haspatch added
Port: postgresql91-server added

Looks like this is happening because the port is setting add_users in the destroot phase, which doesn't work right. It should do this outside the phase (add_users is a variable that gets processed at the appropriate time, not a command like adduser). The attached patch fixes this, and also lets add_users handle adding the group instead of using addgroup. This fixes the problem for me, and I believe it will do the right thing even when using binary archives.

Changed 12 years ago by drkp (Dan Ports)

Attachment: postgresql91-server.patch added

comment:5 Changed 12 years ago by jeremyhu (Jeremy Huddleston Sequoia)

@andholt, since you dropped off IRC:

<andholt> can anyone please help me figure out how to apply a patch to a portfile?
<andholt> running into this problem: https://trac.macports.org/ticket/33497
* andholt has quit (Client Quit)
<jeremyhu> andholt: cd /path/tpo/dports/databases/postgresql91-server ; curl -L https://trac.macports.org/raw-attachment/ticket/33497/postgresql91-server.patch | patch

comment:6 Changed 12 years ago by drkp (Dan Ports)

I committed this for postgresql91-server in r91170. Still need to fix the other versions...

comment:7 Changed 12 years ago by drkp (Dan Ports)

Resolution: fixed
Status: newclosed

...and for 83, 84, and 90 in r91171. The earlier versions still use adduser, but they're so old they should probably be removed anyway...

Note: See TracTickets for help on using tickets.