HOW TO GET initdb WORKING WITH CYGWIN (if you're getting signal 12's)

From: David Liu <dtliu(at)cs(dot)berkeley(dot)edu>
To: pgsql-cygwin(at)postgresql(dot)org
Subject: HOW TO GET initdb WORKING WITH CYGWIN (if you're getting signal 12's)
Date: 2004-12-20 23:13:47
Message-ID: 005201c4e6e9$8f736790$f80fa8c0@sceptre
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-cygwin

I was having trouble with signal 12's. Lots of people have the problem. A
recipe to fix is on top. A log of an erroneous trial and a successful trial
are below...

These are cleaned up instructions. I got help from this message:
http://archives.postgresql.org/pgsql-bugs/2004-11/msg00174.php

# run cygserver-config
> cygserver-config

# start the cygserver
> cygrunsrv -S cygserver

# set the CYGWIN environment variable
> export CYGWIN=server

# unset the LANG environment variable
> unset LANG

# check [Control Panel] -> [Administrative Tools] ->
# [Services]. Should have a Service with name "CYGWIN cygserver"
# with STATUS = "Started"

# run initdb
> initdb -d -D /cygdrive/e/david/pgdata

########## THE ERROR MESSAGES LOOK LIKE THIS ##########
dtliu(at)sceptre:david$ initdb -D /cygdrive/e/david/pgdata
The files belonging to this database system will be owned by user "dtliu".
This user must also own the server process.

The database cluster will be initialized with locale ENU.

initdb: directory "/cygdrive/e/david/pgdata" exists but is not empty
If you want to create a new database system, either remove or empty
the directory "/cygdrive/e/david/pgdata" or run initdb with an argument
other than
"/cygdrive/e/david/pgdata".
dtliu(at)sceptre:david$ rm -rf /cygdrive/e/david/pgdata
dtliu(at)sceptre:david$ initdb -D /cygdrive/e/david/pgdata
The files belonging to this database system will be owned by user "dtliu".
This user must also own the server process.

The database cluster will be initialized with locale ENU.

creating directory /cygdrive/e/david/pgdata... ok
creating directory /cygdrive/e/david/pgdata/base... ok
creating directory /cygdrive/e/david/pgdata/global... ok
creating directory /cygdrive/e/david/pgdata/pg_xlog... ok
creating directory /cygdrive/e/david/pgdata/pg_clog... ok
selecting default max_connections... Signal 12
Signal 12
Signal 12
Signal 12
Signal 12
Signal 12
10
selecting default shared_buffers... Signal 12
Signal 12
Signal 12
Signal 12
Signal 12
Signal 12
Signal 12
Signal 12
Signal 12
Signal 12
Signal 12
50
creating configuration files... ok
creating template1 database in /cygdrive/e/david/pgdata/base/1... FATAL:
invalid value for parameter "lc_messages": "ENU"

initdb: failed
initdb: removing data directory "/cygdrive/e/david/pgdata"
# END #

########## MY LOG ##########

dtliu(at)sceptre:html$ export CYGWIN=SERVER
dtliu(at)sceptre:html$ unset LANG
dtliu(at)sceptre:html$ cygserver-config
Generating /etc/cygserver.conf file

Warning: The following function requires administrator privileges!

Do you want to install cygserver as service?
(Say "no" if it's already installed as service) (yes/no) yes

The service has been installed under LocalSystem account.
To start it, call `net start cygserver' or `cygrunsrv -S cygserver'.

Further configuration options are available by editing the configuration
file /etc/cygserver.conf. Please read the inline information in that
file carefully. The best option for the start is to just leave it alone.

Please keep in mind, that a client application which wants to use
the services provided by cygserver *must* have the environment variable
CYGWIN set so that it contains the word "server". So, if you don't
need any other special CYGWIN setting, just set it to "server".

It is advisable to add this setting to the Windows system environment.

Basic Cygserver configuration finished. Have fun!

dtliu(at)sceptre:html$ cygrunsrv -S cygserver
dtliu(at)sceptre:david$ initdb -D /cygdrive/e/david/pgdata
The files belonging to this database system will be owned by user "dtliu".
This user must also own the server process.

The database cluster will be initialized with locale C.

creating directory /cygdrive/e/david/pgdata... ok
creating directory /cygdrive/e/david/pgdata/base... ok
creating directory /cygdrive/e/david/pgdata/global... ok
creating directory /cygdrive/e/david/pgdata/pg_xlog... ok
creating directory /cygdrive/e/david/pgdata/pg_clog... ok
selecting default max_connections... 40
selecting default shared_buffers... 1000
creating configuration files... ok
creating template1 database in /cygdrive/e/david/pgdata/base/1... ok
initializing pg_shadow... ok
enabling unlimited row size for system tables... ok
initializing pg_depend... ok
creating system views... ok
loading pg_description... ok
creating conversions... ok
setting privileges on built-in objects... ok
creating information schema... ok
vacuuming database template1... ok
copying template1 to template0... ok

Success. You can now start the database server using:

/usr/bin/postmaster -D /cygdrive/e/david/pgdata
or
/usr/bin/pg_ctl -D /cygdrive/e/david/pgdata -l logfile start

Browse pgsql-cygwin by date

  From Date Subject
Next Message David Liu 2004-12-20 23:42:56 psql hang in emacs/cygwin bash (postgresql-7.4.5)
Previous Message Reini Urban 2004-12-12 06:31:20 Re: socket operation on non-socket error