Re: initdb fails with invalid argument to shmat - Mailing list pgsql-cygwin

From mike g
Subject Re: initdb fails with invalid argument to shmat
Date
Msg-id 1089082480.15115.6.camel@localhost.localdomain
Whole thread Raw
In response to Re: initdb fails with invalid argument to shmat  (Kevin Marth <kem1@peoplepc.com>)
List pgsql-cygwin
Hi,

Did you see this earlier posting today.  Maybe the scripts will help
make sure cygserver is properly called?  I am not familiar with the need
to add Export Cygwin but if it worked for others....

hello mike,

thank your very much for your pointing me to the set-variable cygwin.
although i did "cygwin=server" in my script, i did too little. i missed
the export-statement to the set-variable.

for everybody who is interested in my functioning scripts (on
win-xp-home) i give it in here:

at first i do an initiation of my postgresql-db "pgini" and at the end i
call my script "db-stop" to clean memory of processes (especially
cygserver).

and after that i call my db with "db-start" every time i need it (i
don't use it as a service, i don't use it for production just for
programming), and at the end of my working with my db i call my
"db-stop" again to clean memory. afterwards i exit cygwin or restart my
db with "db-start".

now my scripts:

my "pgini":

#!/bin/sh
# the first very important set-variable
CYGWIN=server
export CYGWIN
# the second very important set-variable - to unset it worked for me
(then language-setting is C).
unset LANG
echo
# the third very important set-variable
PATH=/usr/bin:/usr/sbin:$PATH
export PATH
#echo "IPC-Daemon starten..."
echo
echo "cygserver-config starting..."
cygserver-config
echo "sygserver starten..."
cygserver &
ps -f
echo
echo "initdb starting..."
initdb -D /var/postgresql/data
ps -f
./db-stop

now "db-start":

#!/bin/sh
CYGWIN=server
export CYGWIN
PATH=/usr/bin:/usr/sbin:$PATH
export PATH
echo
echo "sygserver starting..."
cygserver &
ps -f
echo
echo "PostgreSQL starting..."
postmaster -i -D /var/postgresql/data &
ps -f

and finally "db-stop":

#!/bin/sh
echo
echo "PostgreSQL finishing..."
pg_ctl stop -w -D /var/postgresql/data -s -m smart
ps -f
echo
echo "cygserver finishing..."
kill $(ps -f | grep cygserver | awk '{print $2}')
ps -f

greetings and thanks to all
hans


mike g schrieb:
> Hello,
>
> My first guess would be that you added cygwin=server as a local user
> variable instead of a system variable.  If you added it to the variable
> section in the top half of the screen then it was a user variable.  Add
> it to the lower section instead.
>
> Mike
> On Sat, 2004-07-03 at 10:09, zuhans@iname.com wrote:
>
> > hello,
> >
> > after downloading the latest cygwin and postgresql, adding cygwin=server
> > and configuring and starting cygserver i want to do a dbinit but i get
> > signal 12-errors:
> > one when
> > "selecting default max_connections" and one when
> > "selecting default shared_buffers".
> >
> > what did i miss?
> >
> > greetings
> > hans
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 5: Have you checked our extensive FAQ?
> >
> >                http://www.postgresql.org/docs/faqs/FAQ.html
> >
>
On Mon, 2004-07-05 at 06:46, Kevin Marth wrote:
> I am starting cygserver and postgres in the same bash shell. Here is the result of the "env" comand, in case any of
theother variables is of interest. As you can see, CYGWIN=server is included. 
>
> !C:=C:\cygwin\bin
> BLASTER=A220 I5 D1 T4 P330
> CMDLINE=bash --login -i
> COMSPEC=C:\WINDOWS\COMMAND.COM
> CVS_RSH=/bin/ssh
> CYGWIN=server
> HISTCONTROL=ignoredups
> HOME=/home/default
> INFOPATH=/usr/local/info:/usr/info:/usr/share/info:/usr/autotool/devel/info:/usr/autotool/stable/info:
> MAKE_MODE=unix
> MANPATH=/usr/local/man:/usr/man:/usr/share/man:/usr/autotool/devel/man::/usr/ssl/man
> OLDPWD=/home/default/MPPL
>
PATH=/usr/sbin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/COMMAND:/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/COMMAND:/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/COMMAND:.:/cygdrive/c/IBMTOOLS
> PROMPT=$p$g
> PS1=$
> PWD=/home/default
> SHLVL=1
> TEMP=/cygdrive/c/WINDOWS/TEMP
> TERM=cygwin
> TMP=/cygdrive/c/WINDOWS/TEMP
> USER=default
> WINBOOTDIR=C:\WINDOWS
> WINDIR=C:\WINDOWS
> _=/usr/bin/env
>
>
> -----Original Message-----
> From: mike g <mike@thegodshalls.com>
> Sent: Jul 5, 2004 12:23 AM
> To: Kevin Marth <kem1@peoplepc.com>
> Cc: pgsql-cygwin@postgresql.org
> Subject: Re: [CYGWIN] initdb fails with invalid argument to shmat
>
> Ok,
>
> Are you starting cygserver and postgres in the same bash shell or in
> separate bash shells(separate cygwin windows)?
>
> No luck with XP and the source for me yet...
>
> If you run the command, env, from a bash shell does CYGWIN=server appear
> in the listing?
>
> Mike
> On Fri, 2004-07-02 at 02:32, Kevin Marth wrote:
> > Actually, I tried both. I first installed Cygwin and postgresql and various other packages from the Cygwin mirror
atftp://mirror.mcs.anl.gov and encountered the "shmat" problem. I then tried building the source myself, but I wasn't
anymore successful. Note that the Cygwin install from the mirror site was to a pristine environment - there wasn't an
existingCygwin installation on my PC prior to my original post to this group on Sunday. 
> >
> > -----Original Message-----
> > From: mike g <mike@thegodshalls.com>
> > Sent: Jul 1, 2004 11:33 PM
> > To: Kevin Marth <kem1@peoplepc.com>
> > Cc: pgsql-cygwin@postgresql.org
> > Subject: Re: [CYGWIN] initdb fails with invalid argument to shmat
> >
> > You are correct that services cannot be run under ME.
> >
> > Did you build from source or install it as cygwin package?
> >
> > I receive the same error when trying to run it under XP when building
> > from source.  Using the cygwin package it works fine.  I have not yet
> > had the time to continue to debug why I can't execute from the source
> > code.
> >
> > On Thu, 2004-07-01 at 13:43, Kevin Marth wrote:
> > > I am working with Windows ME. I could be mistaken, but it doesn't seem possible to run as a service under ME.
WhenI try to invoke cygrunsrv, I get a message basically saying that "this service is unavailable". If I am mistaken,
thenI could use some further clarification about how to run as a service under ME. Thanks. 
> > >
> > > -----Original Message-----
> > > From: mike g <mike@thegodshalls.com>
> > > Sent: Jun 30, 2004 10:54 PM
> > > To: Kevin Marth <kem1@peoplepc.com>
> > > Cc: pgsql-cygwin@postgresql.org
> > > Subject: Re: [CYGWIN] initdb fails with invalid argument to shmat
> > >
> > > What version of windows is this on and are you trying to run it as a
> > > service?
> > >
> > >
> > > On Sun, 2004-06-27 at 00:13, Kevin Marth wrote:
> > > > I am using Cygwin 1.5.10-3 and postgresql 7.4.3-1 freshly downloaded and installed from scratch earlier today.
> > > >
> > > > I have set CYGWIN=server and started cygserver (from the default account).
> > > >
> > > > I receive the following when I execute "initdb -D /home/default/data --debug". Can someone set me straight? I
don'tsee this particular problem in the archives. Thanks. 
> > > >
> > > > ================
> > > >
> > > > Running in debug mode.
> > > >
> > > > initdb: internal variables:
> > > >   PGDATA=/home/default/data
> > > >   datadir=/usr/share/postgresql
> > > >   PGPATH=/usr/bin
> > > >   ENCODING=
> > > >   ENCODINGID=0
> > > >   POSTGRES_SUPERUSERNAME=default
> > > >   POSTGRES_BKI=/usr/share/postgresql/postgres.bki
> > > >   POSTGRES_DESCR=/usr/share/postgresql/postgres.description
> > > >   POSTGRESQL_CONF_SAMPLE=/usr/share/postgresql/postgresql.conf.sample
> > > >   PG_HBA_SAMPLE=/usr/share/postgresql/pg_hba.conf.sample
> > > >   PG_IDENT_SAMPLE=/usr/share/postgresql/pg_ident.conf.sample
> > > > The files belonging to this database system will be owned by user "default".
> > > > This user must also own the server process.
> > > >
> > > > The database cluster will be initialized with locale C.
> > > >
> > > > creating directory /home/default/data... ok
> > > > creating directory /home/default/data/base... ok
> > > > creating directory /home/default/data/global... ok
> > > > creating directory /home/default/data/pg_xlog... ok
> > > > creating directory /home/default/data/pg_clog... ok
> > > > selecting default max_connections... 10
> > > > selecting default shared_buffers... 50
> > > > creating configuration files... ok
> > > > creating template1 database in /home/default/data/base/1... DEBUG:  invoking IpcMemoryCreate(size=1081344)
> > > > FATAL:  shmat(id=983040) failed: Invalid argument
> > > > DEBUG:  proc_exit(1)
> > > > DEBUG:  shmem_exit(1)
> > > > DEBUG:  exit(1)
> > > >
> > > >
> > > > ________________________________________
> > > > PeoplePC Online
> > > > A better way to Internet
> > > > http://www.peoplepc.com
> > > >
> > > > ---------------------------(end of broadcast)---------------------------
> > > > TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
> > >
> > >
> > > ________________________________________
> > > PeoplePC Online
> > > A better way to Internet
> > > http://www.peoplepc.com
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 2: you can get off all lists at once with the unregister command
> >     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
> >
> >
> > ________________________________________
> > PeoplePC Online
> > A better way to Internet
> > http://www.peoplepc.com
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 9: the planner will ignore your desire to choose an index scan if your
> >       joining column's datatypes do not match
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
>                http://www.postgresql.org/docs/faqs/FAQ.html
>
>
>
> ________________________________________
> PeoplePC Online
> A better way to Internet
> http://www.peoplepc.com

pgsql-cygwin by date:

Previous
From: Kevin Marth
Date:
Subject: Re: initdb fails with invalid argument to shmat
Next
From: David Riggs
Date:
Subject: Got it! Re: cygserver fails with "failed to create named pipe,fatal error on IPC transport"