Hi Serge,

> I know about that issue. The easy fix would be to all a sleep command
> just after
> 
> runasowner "$OCF_RESKEY_pgctl $pgctl_options start"
> 
> So it'll look like:
> 
>     # Invoke pg_ctl
>     runasowner "$OCF_RESKEY_pgctl $pgctl_options start"
> 
>     if [ $? -eq 0 ]; then
>         # Probably started.....
>         ocf_log info "PostgreSQL start command sent."
>     else
>         ocf_log err "Can't start PostgreSQL."
>         return $OCF_ERR_GENERIC
>     fi
> 
>     sleep 2
> 
>     while :
>     do

I do not think that sleep of two seconds can wait for start of postgres surely. 

I think that we change by environment and the situation of the load of the CPU 
in time that start of
postgres takes.

Best Regards,
Hideo Yamauchi.



--- Serge Dubrouski <serge...@gmail.com> wrote:

> On Sat, Sep 18, 2010 at 8:26 PM,  <renayama19661...@ybb.ne.jp> wrote:
> > Hi Serge,
> >
> > Thank you for comment.
> >
> >> Do you think that changing that "ocf_log $loglevel" to "ocf_log err"
> >> will be better?
> >
> >
> > Is your opinion the next change?
> >
> > (snip)
> > &#160; &#160; &#160; &#160;elif [ $rc -eq 2 ]; then
> > &#160; &#160; &#160; &#160; &#160; &#160;ocf_log err "Connection error 
> > (connection to the server
went bad and the --->
> > $loglevel->err this???
> 
> Yes.
> 
> >
> > (snip)
> >
> > By the start handling of pgsql, the monitor processing does not succeed 
> > immediately.
> > It is recorded in log by an error to success when we perform this change.
> >
> > After all this confuses an operator.
> 
> I know about that issue. The easy fix would be to all a sleep command
> just after
> 
> runasowner "$OCF_RESKEY_pgctl $pgctl_options start"
> 
> So it'll look like:
> 
>     # Invoke pg_ctl
>     runasowner "$OCF_RESKEY_pgctl $pgctl_options start"
> 
>     if [ $? -eq 0 ]; then
>         # Probably started.....
>         ocf_log info "PostgreSQL start command sent."
>     else
>         ocf_log err "Can't start PostgreSQL."
>         return $OCF_ERR_GENERIC
>     fi
> 
>     sleep 2
> 
>     while :
>     do
> 
> >
> > However, it is considerably troublesome to let ocf_run support loglevel.
> >
> > I think a little more, too.
> >
> > Best Regards,
> > Hideo Yamauchi.
> >
> >
> > --- Serge Dubrouski <serge...@gmail.com> wrote:
> >
> >> Do you think that changing that "ocf_log $loglevel" to "ocf_log err"
> >> will be better?
> >>
> >> Thanks.
> >>
> >> On Fri, Sep 17, 2010 at 12:48 AM, &#160;<renayama19661...@ybb.ne.jp> wrote:
> >> > Hi Serge,
> >> >
> >> > When we use ocf_run in some pgsql, a problem is left.
> >> >
> >> > In ocf_run, ocf_run outputs log as an error in the case of 2 the 
> >> > practice result of the
> >> command.
> >> >
> >> > ocf_run() {
> >> > (snip)
> >> > &#160; &#160; &#160; &#160;else
> >> > &#160; &#160; &#160; &#160; &#160; &#160;if [ ! -z "$output" ]; then
> >> > &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;ocf_log err 
> >> > "$output"
> >> > &#160; &#160; &#160; &#160; &#160; &#160;else
> >> > &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;ocf_log err 
> >> > "command failed: $*"
> >> > &#160; &#160; &#160; &#160; &#160; &#160;fi
> >> > &#160; &#160; &#160; &#160; &#160; &#160;return $rc
> >> > &#160; &#160; &#160; &#160;fi
> >> > }
> >> >
> >> > But, in pgsql side, the log is output by an error or warning in the case 
> >> > of 2 the practice
> >> result of
> >> > the command by a loglevel variable.
> >> >
> >> >
> >> > pgsql_monitor() {
> >> > &#160; &#160;local loglevel
> >> > (snip)
> >> > &#160; &#160;runasowner -q "$OCF_RESKEY_psql $psql_options -c 'select 
> >> > now();'"
> >> >
> >> > &#160; &#160;rc=$?
> >> > &#160; &#160;if [ $rc -ne &#160;0 ]; then
> >> > &#160; &#160; &#160; &#160;ocf_log $loglevel "PostgreSQL 
> >> > $OCF_RESKEY_pgdb isn't running"
> >> > &#160; &#160; &#160; &#160;if [ $rc -eq 1 ]; then
> >> > &#160; &#160; &#160; &#160; &#160; &#160;ocf_log err "Fatal error (out 
> >> > of memory, file not
> found,
> > etc.) occurred while
> >> executing
> >> > the psql command."
> >> > &#160; &#160; &#160; &#160;elif [ $rc -eq 2 ]; then
> >> > &#160; &#160; &#160; &#160; &#160; &#160;ocf_log $loglevel "Connection 
> >> > error (connection to
> the
> > server went bad and the
> >> session was
> >> > not interactive) occurred while executing the psql command."
> >> > &#160; &#160; &#160; &#160;elif [ $rc -eq 3 ]; then
> >> > &#160; &#160; &#160; &#160; &#160; &#160;ocf_log err "Script error (the 
> >> > variable
> ON_ERROR_STOP was
> > set) occurred while
> >> executing
> >> > the psql command."
> >> > &#160; &#160; &#160; &#160;fi
> >> > &#160; &#160; &#160; &#160;return $OCF_ERR_GENERIC
> >> > &#160; &#160;fi
> >> > (snip)
> >> >
> >> > This difference confuses an operator.
> >> >
> >> > Best Regards,
> >> > Hideo Yamauchi.
> >> >
> >> >
> >> > _______________________________________________________
> >> > Linux-HA-Dev: Linux-HA-Dev@lists.linux-ha.org
> >> > http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
> >> > Home Page: http://linux-ha.org/
> >> >
> >>
> >>
> >>
> >> --
> >> Serge Dubrouski.
> >> _______________________________________________________
> >> Linux-HA-Dev: Linux-HA-Dev@lists.linux-ha.org
> >> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
> >> Home Page: http://linux-ha.org/
> >>
> >
> > _______________________________________________________
> > Linux-HA-Dev: Linux-HA-Dev@lists.linux-ha.org
> > http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
> > Home Page: http://linux-ha.org/
> >
> 
> 
> 
> -- 
> Serge Dubrouski.
> _______________________________________________________
> Linux-HA-Dev: Linux-HA-Dev@lists.linux-ha.org
> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
> Home Page: http://linux-ha.org/
> 

_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev@lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/

Reply via email to