[pgpool-hackers: 3498] Re: [Proposal] Check if socket file exists at startup and remove them if PID file doesn't exist.

Tatsuo Ishii ishii at sraoss.co.jp
Thu Jan 23 14:27:08 JST 2020


> Hello,
> 
> On Thu, 23 Jan 2020 11:47:36 +0900 (JST)
> Tatsuo Ishii <ishii at sraoss.co.jp> wrote:
> 
>> > But, when I change ereport(...) -> fprintf(stderr...),
>> > 
>> > 
>> >        if (pid > 0)
>> >           {   
>> >               if (kill(pid, 0) == 0)
>> >               {   
>> >                   fprintf(stderr, "pid file found. is another pgpool(%d) is running?\n", pid);
>> >               }   
>> >               else
>> >               {   
>> >                   fprintf(stderr, "pid file found but it seems bogus. Trying to start pgpool anyway...\n");                              
>> >               }   
>> >           } 
>> > 
>> > the messages are redirected to log file, instead of standard output.
>> > Is it expected behavior?
>> 
>> Sure. Because you redirected pgpool's stderror to the log file, didn't you?
> 
> Yes. I redirected pgpool's standard error to log file.
> 
> And I forgot to add "exit(EXIT_FAILURE);" after the first "fprintf()".
> Without that pid file will be deleted.
> 
> New patch is attached.

Looks good to me.

Best regards,
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese:http://www.sraoss.co.jp


More information about the pgpool-hackers mailing list