Thread: Initdb not running on beos

Initdb not running on beos

From
Cyril VELTER
Date:
I've a problem with initdb on beos with the current tree. (The last one 
running clean is one month old).
   when I run initdb, I get the following : 

$ initdb -d -n
Running with debug mode on.
Running with noclean mode on. Mistakes will not be cleaned up.

Initdb variables: PGDATA=/boot/home/pgsql/data datadir=/boot/home/pgsql/share PGPATH=/boot/home/pgsql/bin
TEMPFILE=/tmp/initdb.9519MULTIBYTE= MULTIBYTEID=0 POSTGRES_SUPERUSERNAME=baron POSTGRES_SUPERUSERID=1
TEMPLATE1_BKI=/boot/home/pgsql/share/template1.bkiGLOBAL_BKI=/boot/home/pgsql/share/global.bki
TEMPLATE1_DESCR=/boot/home/pgsql/share/template1.descriptionGLOBAL_DESCR=/boot/home/pgsql/share/global.description
POSTGRESQL_CONF_SAMPLE=/boot/home/pgsql/share/postgresql.conf.sample
PG_HBA_SAMPLE=/boot/home/pgsql/share/pg_hba.conf.samplePG_IDENT_SAMPLE=/boot/home/pgsql/share/pg_ident.conf.sample
 
This database system will be initialized with username "baron".
This user will own all the data files and must also own the server process.

Creating directory /boot/home/pgsql/data
Creating directory /boot/home/pgsql/data/base
Creating directory /boot/home/pgsql/data/global
Creating directory /boot/home/pgsql/data/pg_xlog
Creating template1 database in /boot/home/pgsql/data/base/1
Running: /boot/home/pgsql/bin/postgres -boot -x1 -C -F -D/boot/home/pgsql/
data -d template1
FATAL 2:  InitReopen(logfile 0 seg 0) failed: No such file or directory

initdb failed.
Data directory /boot/home/pgsql/data will not be removed at user's request.              
   any idea ?
       cyril 



Re: Initdb not running on beos

From
Tom Lane
Date:
Cyril VELTER <cyril.velter@libertysurf.fr> writes:
> FATAL 2:  InitReopen(logfile 0 seg 0) failed: No such file or directory

Does BeOS not support link(2) ?

See XLogFileInit() in src/backend/access/transam/xlog.c.
        regards, tom lane


Re: Initdb not running on beos

From
Cyril VELTER
Date:
   Unfortunatly, there is no hard link on beos :=(. link and unlink are 
there, but link always return "No such file or directory".
   BTW, What the code in XLogFileInit is supposed to do ? Why not create the 
file with the right name in the first step ?
   I have tried to create the file whith the right name and remove all link/
unlink. After that, initdb does works but after I have a quite strange 
behavior :       * Every select return 0 row (the columns are there, but no datas)   * Every create  or insert crash
thebackend.   * If I do nothing, the backend will crash after some minutes      is it related to the first hack ? or is
theresomething else ?
 

           cyril


>Cyril VELTER <cyril.velter@libertysurf.fr> writes:
>> FATAL 2:  InitReopen(logfile 0 seg 0) failed: No such file or directory
>
>Does BeOS not support link(2) ?
>
>See XLogFileInit() in src/backend/access/transam/xlog.c.
>
>            regards, tom lane
>



Re: Initdb not running on beos

From
Tom Lane
Date:
Cyril VELTER <cyril.velter@libertysurf.fr> writes:
>     Unfortunatly, there is no hard link on beos :=(. link and unlink are 
> there, but link always return "No such file or directory".

Somewhere right around here is where I am going to ask why we are
entertaining the idea of a BeOS port in the first place... it's
evidently not Unix or even trying hard to be close to Unix.

Bad enough to have dozens of #ifdef __BEOS__ already uglifying the code;
I don't intend to hold still for people saying "you can't use link()".
        regards, tom lane


Re: Initdb not running on beos

From
Adam Haberlach
Date:
On Mon, Nov 27, 2000 at 04:09:46PM -0500, Tom Lane wrote:
> Cyril VELTER <cyril.velter@libertysurf.fr> writes:
> >     Unfortunatly, there is no hard link on beos :=(. link and unlink are 
> > there, but link always return "No such file or directory".
> 
> Somewhere right around here is where I am going to ask why we are
> entertaining the idea of a BeOS port in the first place... it's
> evidently not Unix or even trying hard to be close to Unix.
You've asked this before.
How does Windows manage to work?

-- 
Adam Haberlach           |"California's the big burrito, Texas is the big
adam@newsnipple.com      | taco ... and following that theme, Florida is
http://www.newsnipple.com| the big tamale ... and the only tamale that 
'88 EX500                | counts any more." -- Dan Rather 


Re: Initdb not running on beos

From
Tom Lane
Date:
Adam Haberlach <adam@newsnipple.com> writes:
> On Mon, Nov 27, 2000 at 04:09:46PM -0500, Tom Lane wrote:
>> Somewhere right around here is where I am going to ask why we are
>> entertaining the idea of a BeOS port in the first place... it's
>> evidently not Unix or even trying hard to be close to Unix.

>     You've asked this before.

>     How does Windows manage to work?

Objection!  Point not in evidence!

;-)

Seriously, we do not pretend to run on Windows.  It does seem to be
possible to run Postgres atop Cygwin's Unix emulation atop Windows.
However, that's only because of some superhuman efforts from the
Cygwin team, not because Windows is a Postgres-compatible platform.

As far as the original question goes, I suspect that a rename() would
work just as well as the link()/unlink() combo that's in that code now.
I would have no objection to a submitted patch along that line.  But the
target audience for Postgres is POSIX-compatible platforms, and I do not
think that the core group of developers should be spending much time on
hacking the code to work on platforms that can't meet the POSIX spec.
If anyone else wants to make that happen, we'll accept patches ... but
don't expect us to supply solutions, OK?
        regards, tom lane


Re: Initdb not running on beos

From
Alfred Perlstein
Date:
* Tom Lane <tgl@sss.pgh.pa.us> [001128 20:48] wrote:
> Adam Haberlach <adam@newsnipple.com> writes:
> > On Mon, Nov 27, 2000 at 04:09:46PM -0500, Tom Lane wrote:
> >> Somewhere right around here is where I am going to ask why we are
> >> entertaining the idea of a BeOS port in the first place... it's
> >> evidently not Unix or even trying hard to be close to Unix.
> 
> >     You've asked this before.
> 
> >     How does Windows manage to work?
> 
> Objection!  Point not in evidence!
> 
> ;-)
> 
> Seriously, we do not pretend to run on Windows.  It does seem to be
> possible to run Postgres atop Cygwin's Unix emulation atop Windows.
> However, that's only because of some superhuman efforts from the
> Cygwin team, not because Windows is a Postgres-compatible platform.
> 
> As far as the original question goes, I suspect that a rename() would
> work just as well as the link()/unlink() combo that's in that code now.
> I would have no objection to a submitted patch along that line.  But the
> target audience for Postgres is POSIX-compatible platforms, and I do not
> think that the core group of developers should be spending much time on
> hacking the code to work on platforms that can't meet the POSIX spec.
> If anyone else wants to make that happen, we'll accept patches ... but
> don't expect us to supply solutions, OK?

Afaik the atomicity of rename() (the same as a link()/unlink() pair)
is specified by POSIX.

Sorry for jumping in late in the thread, but rename() sure sounds a
lot better than a link()/unlink() pair, but I'm probably taking it
out of context.

-- 
-Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org]
"I have the heart of a child; I keep it in a jar on my desk."


Re: Initdb not running on beos

From
Peter Eisentraut
Date:
Adam Haberlach writes:

>     How does Windows manage to work?

Windows NT has hard links.

-- 
Peter Eisentraut      peter_e@gmx.net       http://yi.org/peter-e/