delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/01/27/08:58:30

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-0.5 required=5.0 tests=AWL,BAYES_50,J_CHICKENPOX_83
X-Spam-Check-By: sourceware.org
Message-ID: <497F12F5.8040305@x-ray.at>
Date: Tue, 27 Jan 2009 14:58:13 +0100
From: Reini Urban <rurban AT x-ray DOT at>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de-AT; rv:1.8.1.19) Gecko/20081204 SeaMonkey/1.1.14
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: Vista - postgresql 8.2.11 - won't start, psql FATAL role does not exist
References: <80152cdc0901270541u6116d710n653fcfcd6fbddfbc AT mail DOT gmail DOT com>
In-Reply-To: <80152cdc0901270541u6116d710n653fcfcd6fbddfbc@mail.gmail.com>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Note-from-DJ: This may be spam

Keith Christian schrieb:
> I'd like to get PostgreSQL running on my Vista machine.
> 
> I've been following the "impatient" instructions at the end of
> /usr/share/doc/Cygwin/postgresql-8.2.11.README as shown below:
> 
> 
>      1  Installation:
>      2
>      3  For the impatient: install as service (hard)

hard is really "hard"

>      4
>      5      # save old database (optional)
>      6      pg_dumpall -g /tmp/$$pgdump-globals.sql
>      7      pg_dumpall > /tmp/$$pgdump.sql
>      8      # adjust the settings in /etc/rc.d/init.d/postgresql
>      9      nano /etc/rc.d/init.d/postgresql
>     10      sysbash # /etc/rc.d/init.d/postgresql initdb
>     11      /etc/rc.d/init.d/postgresql install
>     12      /etc/rc.d/init.d/postgresql start
> 
> 
> Below is a screen capture showing what transpired:
> 
> 
> Tue Jan 27 06:04:36 (keith AT tycho) ~>rm -rf /usr/share/postgresql/data/
> 
> ########## (Line 9 above) - What settings should be adjusted in
> /etc/rc.d/init.d/postgresql for a starting Cygwin installation???

PGDATA, POSTMASTER_ARGS or INITDB_ARGS could be adjusted.

> ########## (Line 10 above) - What is the meaning of "sysbash?

A shell running as SYSTEM user. Google for it. There's no program to do 
  that automatically, just a trick to get "root" (SYSTEM user) access on 
windows.

> Tue Jan 27 06:06:04 (keith AT tycho) ~>/etc/rc.d/init.d/postgresql initdb
> The files belonging to this database system will be owned by user "keith".
> This user must also own the server process.

So you initialized the database as user keith and not as SYSTEM.
So the service must belong to use keith and not SYSTEM.

> The database cluster will be initialized with locale C.
> 
> creating directory /usr/share/postgresql/data ... ok
> creating subdirectories ... ok
> selecting default max_connections ... 40
> selecting default shared_buffers/max_fsm_pages ... 32MB/204800
> creating configuration files ... ok
> creating template1 database in /usr/share/postgresql/data/base/1 ... ok
> initializing pg_authid ... ok
> initializing dependencies ... ok
> creating system views ... ok
> loading system objects' descriptions ... ok
> creating conversions ... ok
> setting privileges on built-in objects ... ok
> creating information schema ... ok
> vacuuming database template1 ... ok
> copying template1 to template0 ... ok
> copying template1 to postgres ... ok
> 
> WARNING: enabling "trust" authentication for local connections
> You can change this by editing pg_hba.conf or using the -A option the
> next time you run initdb.
> 
> Success. You can now start the database server using:
> 
>     /usr/sbin/postgres -D /usr/share/postgresql/data   (AAAAA)
> or
>     /usr/sbin/pg_ctl -D /usr/share/postgresql/data -l logfile start  (BBBBB)
> 
> done.
> 
> ########## Confusion here - The previous lines at the end of initdb
> (labeled AAAAA and BBBBB above) instruct the user to try one of two
> command lines to start Postgres.  In the README file there are two
> lines following "initdb", one ending with "install" and the other
> ending with "start."  How should the user proceed at this point?

One of the three, preferred the one I gave in my instruction.
      sysbash # (analog to sudo SYSTEM)
      /etc/rc.d/init.d/postgresql initdb
      /etc/rc.d/init.d/postgresql install
      /etc/rc.d/init.d/postgresql start

But only the manual way to start the database will work because you 
didn't install it as SYSTEM.
So either AAAAA or BBBBB

> Tue Jan 27 06:10:26 (keith AT tycho) ~>echo $CYGWIN
> ntsec binmode codepage:oem server tty
> 
> Tue Jan 27 06:10:30 (keith AT tycho) ~>/etc/rc.d/init.d/postgresql install
> - cygserver OK - ERROR CYGWIN must contain server for cygserver to work properly

Hmm, this seems to be a script error on my side. Thanks.

> ########## Something wrong with the error message above - CYGWIN does
> indeed contain "server", see above ^^^^^
> 
> Tue Jan 27 06:11:30 (keith AT tycho) ~>/etc/rc.d/init.d/postgresql start
> Starting PostgreSQL: - cygserver OK - ERROR CYGWIN must contain server
> for cygserver to work properly

> Tue Jan 27 06:11:40 (keith AT tycho) ~>psql -U keith -d postgres
> psql: could not connect to server: No such file or directory
>         Is the server running locally and accepting
>         connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
> 
> ***************************************************
> ** SECTIONS OF POSTGRESQL'S LOGFILE APPEAR BELOW **
> ***************************************************
> 
> Tue Jan 27 06:13:51 (keith AT tycho) ~>ls -l logfile
> -rw------- 1 keith None 297212 Jan 27 06:13 logfile
> 
> Tue Jan 27 06:13:55 (keith AT tycho) ~>cat -n logfile
>      1  LOG:  database system was shut down at 2009-01-27 06:08:33 MST
>      2  LOG:  checkpoint record is at 0/485AD0
>      3  LOG:  redo record is at 0/485AD0; undo record is at 0/0; shutdown TRUE
>      4  LOG:  next transaction ID: 0/593; next OID: 10820
>      5  LOG:  next MultiXactId: 1; next MultiXactOffset: 0
>      6  LOG:  database system is ready
>      7        3 [main] postgres 4352 _cygtls::handle_exceptions: Error
> while dumping state (probably corrupt                  ed stack)
>      8    21805 [main] postgres 4352 _cygtls::handle_exceptions: Error
> while dumping state (probably corrupt                  ed stack)
>      9    22208 [main] postgres 4352 _cygtls::handle_exceptions: Error
> while dumping state (probably corrupt                  ed stack)
>     10    22543 [main] postgres 4352 _cygtls::handle_exceptions: Error
> while dumping state (probably corrupt                  ed stack)
> 
> ************************************
> **     LINES CLIPPED FROM LOG     **
> ************************************
> 
>   2696  1961785 [main] postgres 4352 _cygtls::handle_exceptions: Error
> while dumping state (probably corrupt                  ed stack)
>   2697  1962167 [main] postgres 4352 _cygtls::handle_exceptions: Error
> while dumping state (probably corrupt                  ed stack)
>   2698  1962554 [main] postgres 4352 _cygtls::handle_exceptions: Error
> while dumping state (probably corrupt                  ed stack)
>   2699       19 [main] postgres 5624 fork: child 4352 - died waiting
> for dll loading, errno 11
>   2700  LOG:  could not fork background writer process: Resource
> temporarily unavailable
>   2701  LOG:  server process (PID 4352) exited with exit code 5
>   2702  LOG:  terminating any other active server processes
>   2703  LOG:  all server processes terminated; reinitializing
>   2704  LOG:  database system was interrupted at 2009-01-27 06:13:41 MST
>   2705  LOG:  checkpoint record is at 0/485AD0
>   2706  LOG:  redo record is at 0/485AD0; undo record is at 0/0; shutdown TRUE
>   2707  LOG:  next transaction ID: 0/593; next OID: 10820
>   2708  LOG:  next MultiXactId: 1; next MultiXactOffset: 0
>   2709  LOG:  database system was not properly shut down; automatic
> recovery in progress
>   2710  LOG:  record with zero length at 0/485B20
>   2711  LOG:  redo is not required
>   2712  LOG:  database system is ready
> 
> Tue Jan 27 06:14:00 (keith AT tycho) ~>psql -U keith -d postgres
> psql: FATAL:  role "keith" does not exist

Good, the database seems to be running nevertheless

> What other steps should I take?  What other information should I
> provide to help troubleshoot this problem?

So your running it as keith.
Add the db and role keith.

$ createdb keith
$ createuser -S -R -d keith

-- 
Reini Urban
http://phpwiki.org/  http://murbreak.at/

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019