Thread: Re: Re: [BUGS] syslog logging setup broken?

Re: Re: [BUGS] syslog logging setup broken?

From
"Nic Ferrier"
Date:
>>> Bruce Momjian <pgman@candle.pha.pa.us> 04-Feb-01 10:07:40 PM >>>

>> The bottom line is that, IMHO, writing a portable 
>> init.d style (or any other such concept) startup file 
>> that is ready for blind use is beyond practicality.  
>> It might be better to collect a few of the ones that are
>> being used now (Red Hat-style, SuSE-style, Debian, 
>> *BSD-style) and ship them.  This should be coordinated 
>>with the packagers, though. 

>Should I remove init.d from /contrib?

I'm just a postgres user but I don't agree with Peter. I think the
file is valuable.

The file is valuable for people not using a distribution such as
Debian, etc... and also is usefull to people developing packages for
distributions.

I don't use a packaged postgres and it was certainly valuable to me
because it served as an example of what I had to do to get postgres
going quickly in the way that I wanted.

I sent Peter an updated file that IMHO irons out some problems which
may cause Peter to consider the file broken:

- ouptut was being piped to the logger if "syslog" was on
It's not necessary to do that because postgres handles the decision
about syslog depending on the conf file.

- the postmaster was being started without nohup

- the system for setting options wasn't very usefull
the system that I've replaced it with isn't terribly usefull either
but it works.


So anyway, my view as a user is that it's usefull and that a package
specific version would come with the package anyway.


Nic Ferrier
Tapsell-Ferrier Limited



Re: Re: [BUGS] syslog logging setup broken?

From
"Oliver Elphick"
Date:
"Nic Ferrier" wrote: >- the postmaster was being started without nohup
If postmaster is being started by init, it should not need nohup, because
init never exits and postmaster is not going to get shutdown unexpectedly.

nohup has a performance cost, in that (at least on Linux) it automatically
nices (lowers the priority of) the process.  You may not want the
priority lowered...

-- 
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight                              http://www.lfix.co.uk/oliver
PGP: 1024R/32B8FAA1: 97 EA 1D 47 72 3F 28 47  6B 7E 39 CC 56 E4 C1 47
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
========================================   "Lift up your heads, O ye gates; and be ye lift up, ye      everlasting
doors;and the King of glory shall come      in. Who is this King of glory? The LORD strong and      mighty, the LORD
mightyin battle."                                             Psalms 24:7,8 
 




Re: Re: [BUGS] syslog logging setup broken?

From
Tom Lane
Date:
"Oliver Elphick" <olly@lfix.co.uk> writes:
> "Nic Ferrier" wrote:
>>>> - the postmaster was being started without nohup
> If postmaster is being started by init, it should not need nohup, because
> init never exits and postmaster is not going to get shutdown unexpectedly.

On the other hand, when pg_ctl is invoked by hand, it probably is a bug
that it fails to use nohup.  Perhaps this is a reason why pg_ctl should
not be made into a substitute for a startup script?
        regards, tom lane


Re: Re: [BUGS] syslog logging setup broken?

From
Tatsuo Ishii
Date:
> > If postmaster is being started by init, it should not need nohup, because
> > init never exits and postmaster is not going to get shutdown unexpectedly.
> 
> On the other hand, when pg_ctl is invoked by hand, it probably is a bug
> that it fails to use nohup.  Perhaps this is a reason why pg_ctl should
> not be made into a substitute for a startup script?

If pg_ctl unconditionally use nohup, it might be a performance penalty
as Oliver mentioned.

> nohup has a performance cost, in that (at least on Linux) it automatically
> nices (lowers the priority of) the process.  You may not want the
> priority lowered...

Moreover if postmaster detaches itself to be a deamon, nohup is not
necessary at all.

BTW, for the startup script, I don't think we need to use pg_ctl.
Invoking postmaster directry seems enough for me. The only reason for
using pg_ctl to start postmaster is waiting for postmaster up and
running. In most cases the time to recover DB would not be so
long. And if the recovery took too long time, we would not want to be
blocked in the middle of the boot sequence anyway.

Comments?
--
Tatsuo Ishii


Re: Re: [BUGS] syslog logging setup broken?

From
Peter Eisentraut
Date:
Tatsuo Ishii writes:

> Moreover if postmaster detaches itself to be a deamon, nohup is not
> necessary at all.

Right.  Scrap that thought then.

> BTW, for the startup script, I don't think we need to use pg_ctl.
> Invoking postmaster directry seems enough for me. The only reason for
> using pg_ctl to start postmaster is waiting for postmaster up and
> running.

Waiting for the postmaster to start up is really only useful when you
start it interactively, either during development, or if you need to
repair a problem.  In either of these cases you might as well (and
probably rather should) look at the log output yourself, i.e., just use
'postmaster'.

> In most cases the time to recover DB would not be so
> long. And if the recovery took too long time, we would not want to be
> blocked in the middle of the boot sequence anyway.

Exactly.  No waiting on startup by default then?

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