Обсуждение: Antw: Re: Patch for NetWare support

Поиск
Список
Период
Сортировка

Antw: Re: Patch for NetWare support

От
"Ulrich Neumann"
Дата:
Hi Bruce

another solution can be to surround the patch with:

#ifdef N_PLAT_NLM
...
...
#endif

Ulrich

>>> "Ulrich Neumann" <U_Neumann@gne.de> 12.08.2002 18:06:48 >>>
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


---------------------------(end of
broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html
----------------------------------
  This e-mail is virus scanned
  Diese e-mail ist virusgeprueft


Re: Antw: Re: Patch for NetWare support

От
Bruce Momjian
Дата:
We have to do that, at a minimum.  I am trying to figure out how to get
this option in there without documentating it for the other 15+
platforms we support.

Most likely, we would define a port name in configure.in and test for
that before accepting that flag.  Also, there would be _no_
documentation of this flags existance in the PostgreSQL documentation.
It is only used by the postmaster calling postgres, so that should be
OK.

I just wanted to make sure I understood the issues before moving forward
with your patches.

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

Ulrich Neumann wrote:
> Hi Bruce
>
> another solution can be to surround the patch with:
>
> #ifdef N_PLAT_NLM
> ...
> ...
> #endif
>
> Ulrich
>
> >>> "Ulrich Neumann" <U_Neumann@gne.de> 12.08.2002 18:06:48 >>>
> 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
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
> ----------------------------------
>   This e-mail is virus scanned
>   Diese e-mail ist virusgeprueft
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
>

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: Antw: Re: Patch for NetWare support

От
"Ulrich Neumann"
Дата:
Thank you.

Ulrich

>>> Bruce Momjian <pgman@candle.pha.pa.us> 12.08.2002 18:54:35 >>>

We have to do that, at a minimum.  I am trying to figure out how to
get
this option in there without documentating it for the other 15+
platforms we support.

Most likely, we would define a port name in configure.in and test for
that before accepting that flag.  Also, there would be _no_
documentation of this flags existance in the PostgreSQL documentation.

It is only used by the postmaster calling postgres, so that should be
OK.

I just wanted to make sure I understood the issues before moving
forward
with your patches.

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

Ulrich Neumann wrote:
> Hi Bruce
>
> another solution can be to surround the patch with:
>
> #ifdef N_PLAT_NLM
> ...
> ...
> #endif
>
> Ulrich
>
> >>> "Ulrich Neumann" <U_Neumann@gne.de> 12.08.2002 18:06:48 >>>
> 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
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
> ----------------------------------
>   This e-mail is virus scanned
>   Diese e-mail ist virusgeprueft
>
>
> ---------------------------(end of
broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
>

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania
19073

---------------------------(end of
broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org
----------------------------------
  This e-mail is virus scanned
  Diese e-mail ist virusgeprueft


Re: Antw: Re: Patch for NetWare support

От
"Ulrich Neumann"
Дата:
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


Re: Antw: Re: Patch for NetWare support

От
Tom Lane
Дата:
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Most likely, we would define a port name in configure.in and test for
> that before accepting that flag.  Also, there would be _no_
> documentation of this flags existance in the PostgreSQL documentation.
> It is only used by the postmaster calling postgres, so that should be
> OK.

I concur with Peter: there seems to be no need for this hack at all.
Just install two copies of the postmaster/postgres executable --- ie,
use cp instead of ln on platforms where ln doesn't work.  The postgres
executable would only be used for standalone-backend operation, which'd
probably mean you could remove it after initdb, if the disk space hit
bothers you.

            regards, tom lane

Re: Antw: Re: Patch for NetWare support

От
"Ross J. Reedstrom"
Дата:
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

Re: Antw: Re: Patch for NetWare support

От
Tom Lane
Дата:
"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

Re: Antw: Re: Patch for NetWare support

От
"Ross J. Reedstrom"
Дата:
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

Re: Antw: Re: Patch for NetWare support

От
Tom Lane
Дата:
"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

Re: Antw: Re: Patch for NetWare support

От
"Ulrich Neumann"
Дата:
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