简体   繁体   中英

postgres unattended install fails on “unknown login: postgres”

I am building an application installer that installs postgresql 9.x in the "unattended" mode. The main script copies the application files into place, then installs postgres via installbuilder.sh. The main script is invoked with admin privileges. I invoke the pg installer in the script as follows:

log "=== install DBMS engine  ==="
./postgresql-9.1.2-1-osx.app/Contents/MacOS/installbuilder.sh --mode unattended --superaccount postgres --superpassword MySecretWord

On Mac OS X 10.7 "Lion", the pg installer runs along for a bit then fails out. The bitrock-installer.log contains the following statements:

Preparing to Install
Executing su - postgres -c "\"/Library/PostgreSQL/9.1/bin/pg_ctl\" stop -m fast -w -D \"/Library/PostgreSQL/9.1/data\""
Script exit code: 1

Script output:

Script stderr:
 su: unknown login: postgres 

At this point, the system, osx 10.7, has a user account "PostgreSQL" but not one named "postgres". After the error in the log are two more errors involved launchd then all subsequent scripts complete normally.

It appears I need to add the postgres group and user prior to installing postgres, but I wonder if that is really the issue.

I have seen advice to modify the PostgreSQL user name, but that is after the installation has run, and that is a bit untidy.

Is adding an account "postgres" the correct thing to do?

使用macports重新安装postgress

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM