Antw: Re: Patch for NetWare support

Started by Ulrich Neumannalmost 24 years ago10 messagespatches
Jump to latest
#1Ulrich Neumann
U_Neumann@gne.de

Hi Bruce,

at the moment NetWare doesn't have symbolic links so it's the only
chance for me to decide between postmaster, bootstrap or normal
interactive backend.

Sorry for that. Novell will add symbolic and hard links to the file
system
but they don't have it yet. As soon as they have links we can remove
the
code.

Ulrich

Bruce Momjian <pgman@candle.pha.pa.us> 09.08.2002 00:47:21 >>>

I wish we didn't have to add this part of the patch to main.c:

+       /*
+        * If the first argument is "-post", then invoke postmaster
mode. Note
+        * we remove "-post" from the arguments passed on to
BootstrapMain.
+     * This is added for one reasons: NetWare doesn't have symbolic
links
+     * right. ((
+        */
+       if (argc > 1 && strcmp(new_argv[1], "-post") == 0)
+               exit(PostmasterMain(argc - 1, new_argv + 1));

Do we have to document this, but only for Netware? Yuck.

---------------------------------------------------------------------------

Ulrich Neumann wrote:

Hello,

attached is a patch for main.c.

The files netware.h and netware.c are for src/backend/port/dynloader

Can anybody create the directory netware at src/backend/port?

The changes in main.c are very small and i've documented them in the
sourcecode.

Thank you.

Ulrich

----------------------------------
This e-mail is virus scanned
Diese e-mail ist virusgeprueft

[ Attachment, skipping... ]

[ Attachment, skipping... ]

[ Attachment, skipping... ]

---------------------------(end of

broadcast)---------------------------

TIP 1: subscribe and unsubscribe commands go to

majordomo@postgresql.org

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us 
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania
19026

---------------------------(end of
broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to
majordomo@postgresql.org
----------------------------------
This e-mail is virus scanned
Diese e-mail ist virusgeprueft

#2Peter Eisentraut
peter_e@gmx.net
In reply to: Ulrich Neumann (#1)
Re: Antw: Re: Patch for NetWare support

Ulrich Neumann writes:

at the moment NetWare doesn't have symbolic links so it's the only
chance for me to decide between postmaster, bootstrap or normal
interactive backend.

Does it have hard links? Does it have 'ln' at all? Otherwise we should
define $(LN_S) to 'cp' and just make a copy. That way we avoid patching
up the code.

--
Peter Eisentraut peter_e@gmx.net

#3Alvaro Herrera
alvherre@atentus.com
In reply to: Peter Eisentraut (#2)
Re: Antw: Re: Patch for NetWare support

Peter Eisentraut dijo:

Ulrich Neumann writes:

at the moment NetWare doesn't have symbolic links so it's the only
chance for me to decide between postmaster, bootstrap or normal
interactive backend.

Does it have hard links? Does it have 'ln' at all? Otherwise we should
define $(LN_S) to 'cp' and just make a copy. That way we avoid patching
up the code.

Doesn't the cp trick invalidate the fork-no-exec performance
optimization?

--
Alvaro Herrera (<alvherre[a]atentus.com>)
"Find a bug in a program, and fix it, and the program will work today.
Show the program how to find and fix a bug, and the program
will work forever" (Oliver Silfridge)

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Alvaro Herrera (#3)
Re: Antw: Re: Patch for NetWare support

Alvaro Herrera <alvherre@atentus.com> writes:

Peter Eisentraut dijo:

Does it have hard links? Does it have 'ln' at all? Otherwise we should
define $(LN_S) to 'cp' and just make a copy. That way we avoid patching
up the code.

Doesn't the cp trick invalidate the fork-no-exec performance
optimization?

No.

regards, tom lane

#5Ulrich Neumann
U_Neumann@gne.de
In reply to: Tom Lane (#4)
Re: Antw: Re: Patch for NetWare support

At the moment there isn't ln at all. Just making a copy of the binary
is a problem because the binary name is compiled in the binary
and if you use srgc[0] NetWare reports "postgres" instead of
"postmaster".

I know that this behaviour isn't UNIX like but today I don't have
another way to do it. In the future NetWare accepts ELF binary
formats and 'links' so we can remove the code later, but it will take
up to a year until we get there.

Ulrich

Peter Eisentraut <peter_e@gmx.net> 12.08.2002 22:06:58 >>>

Ulrich Neumann writes:

at the moment NetWare doesn't have symbolic links so it's the only
chance for me to decide between postmaster, bootstrap or normal
interactive backend.

Does it have hard links? Does it have 'ln' at all? Otherwise we
should
define $(LN_S) to 'cp' and just make a copy. That way we avoid
patching
up the code.

--
Peter Eisentraut peter_e@gmx.net

---------------------------(end of
broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to
majordomo@postgresql.org
----------------------------------
This e-mail is virus scanned
Diese e-mail ist virusgeprueft

#6Ross J. Reedstrom
reedstrm@rice.edu
In reply to: Ulrich Neumann (#5)
Re: Antw: Re: Patch for NetWare support

On Tue, Aug 13, 2002 at 12:16:35AM +0200, Ulrich Neumann wrote:

At the moment there isn't ln at all. Just making a copy of the binary
is a problem because the binary name is compiled in the binary
and if you use srgc[0] NetWare reports "postgres" instead of
"postmaster".

O.K., that just means that instead of 'cp' it'll nead an ugly hack to the
Makefiles that links a seperate executable with the second name. That's
better than an ugly hack in the mainline executable code, I suppose.

Ross

#7Tom Lane
tgl@sss.pgh.pa.us
In reply to: Ross J. Reedstrom (#6)
Re: Antw: Re: Patch for NetWare support

"Ross J. Reedstrom" <reedstrm@rice.edu> writes:

On Tue, Aug 13, 2002 at 12:16:35AM +0200, Ulrich Neumann wrote:

At the moment there isn't ln at all. Just making a copy of the binary
is a problem because the binary name is compiled in the binary
and if you use srgc[0] NetWare reports "postgres" instead of
"postmaster".

O.K., that just means that instead of 'cp' it'll nead an ugly hack to the
Makefiles that links a seperate executable with the second name. That's
better than an ugly hack in the mainline executable code, I suppose.

Should we even do that? What is srgc[0], and why should we care whether
it can tell the difference between postgres and postmaster?

regards, tom lane

#8Ross J. Reedstrom
reedstrm@rice.edu
In reply to: Tom Lane (#7)
Re: Antw: Re: Patch for NetWare support

On Tue, Aug 13, 2002 at 12:54:22PM -0400, Tom Lane wrote:

"Ross J. Reedstrom" <reedstrm@rice.edu> writes:

On Tue, Aug 13, 2002 at 12:16:35AM +0200, Ulrich Neumann wrote:

At the moment there isn't ln at all. Just making a copy of the binary
is a problem because the binary name is compiled in the binary
and if you use srgc[0] NetWare reports "postgres" instead of
"postmaster".

O.K., that just means that instead of 'cp' it'll nead an ugly hack to the
Makefiles that links a seperate executable with the second name. That's
better than an ugly hack in the mainline executable code, I suppose.

Should we even do that? What is srgc[0], and why should we care whether
it can tell the difference between postgres and postmaster?

Depends on how much we want Netware support. I'm assuming srgc[0] is the
Netware equivalent of argv[0], and is being used to determine the name
of the current executable. (I haven't looked closely at Ulrich's patch,
I must admit)

Ross

#9Tom Lane
tgl@sss.pgh.pa.us
In reply to: Ross J. Reedstrom (#8)
Re: Antw: Re: Patch for NetWare support

"Ross J. Reedstrom" <reedstrm@rice.edu> writes:

On Tue, Aug 13, 2002 at 12:54:22PM -0400, Tom Lane wrote:

Should we even do that? What is srgc[0], and why should we care whether
it can tell the difference between postgres and postmaster?

Depends on how much we want Netware support. I'm assuming srgc[0] is the
Netware equivalent of argv[0], and is being used to determine the name
of the current executable.

Oh, oh, it's probably just a typo for argv[0]. Okay, I take back that
thought ... we do need argv[0] to work.

A system-dependent hack in the Makefiles would be at least as ugly as a
system-dependent hack in main.c, but I think I like it better because
then the startup procedure isn't any different on netware than anywhere
else. If I understood the patch as given, people would've had to say
"postmaster -post ..." on netware; that's bad.

regards, tom lane

#10Ulrich Neumann
U_Neumann@gne.de
In reply to: Tom Lane (#9)
Re: Antw: Re: Patch for NetWare support

Hello together,

I've looked into the problem in more detail again and i've found a bug
in LibC on NetWare. I've never seen this before with other
applications but now we can forget about this "hack".

I must say thanks for opening my eyes and solve this in a correct way.

Ulrich

Tom Lane <tgl@sss.pgh.pa.us> 13.08.2002 19:28 >>>

"Ross J. Reedstrom" <reedstrm@rice.edu> writes:

On Tue, Aug 13, 2002 at 12:54:22PM -0400, Tom Lane wrote:

Should we even do that? What is srgc[0], and why should we care

whether

it can tell the difference between postgres and postmaster?

Depends on how much we want Netware support. I'm assuming srgc[0] is

the

Netware equivalent of argv[0], and is being used to determine the

name

of the current executable.

Oh, oh, it's probably just a typo for argv[0]. Okay, I take back that
thought ... we do need argv[0] to work.

A system-dependent hack in the Makefiles would be at least as ugly as
a
system-dependent hack in main.c, but I think I like it better because
then the startup procedure isn't any different on netware than
anywhere
else. If I understood the patch as given, people would've had to say
"postmaster -post ..." on netware; that's bad.

regards, tom lane

---------------------------(end of
broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to
majordomo@postgresql.org)
----------------------------------
This e-mail is virus scanned
Diese e-mail ist virusgeprueft