While I'm agree in general I'm not sure that it wouldn't be better to
modify ocf_run in a way that it would return actual error code form a
command that it ran instead of generic $OCF_ERR_GENERIC


2010/9/1  <renayama19661...@ybb.ne.jp>:
> Hi Serge,
>
> I add a patch, too.
> Because runasowner adopted ocf_run, there is useless "if" statement.
> (ocf_run return only 0 or 1.)
>
> diff -r 49603d860cf7 heartbeat/pgsql
> --- a/heartbeat/pgsql   Thu Sep 02 10:17:59 2010 +0900
> +++ b/heartbeat/pgsql   Thu Sep 02 10:20:31 2010 +0900
> @@ -422,13 +422,6 @@
>     rc=$?
>     if [ $rc -ne  0 ]; then
>        ocf_log $loglevel "PostgreSQL $OCF_RESKEY_pgdb isn't running"
> -        if [ $rc -eq 1 ]; then
> -            ocf_log err "Fatal error (out of memory, file not found, etc.) 
> occurred while executing
> the psql command."
> -        elif [ $rc -eq 2 ]; then
> -            ocf_log $loglevel "Connection error (connection to the server 
> went bad and the session
> was not interactive) occurred while executing the psql command."
> -        elif [ $rc -eq 3 ]; then
> -            ocf_log err "Script error (the variable ON_ERROR_STOP was set) 
> occurred while executing
> the psql command."
> -        fi
>        return $OCF_ERR_GENERIC
>     fi
>
>
> Best Regards,
> Hideo Yamauchi.
>
>
> --- Serge Dubrouski <serge...@gmail.com> wrote:
>
>> Attached is a patch for pgsql to fix the problem with access to the
>> /var/lib/heartbeat/cores/root directory at runtime.
>>
>> --
>> Serge Dubrouski.
>> > diff -r 7200186935f1 heartbeat/pgsql
>> --- a/heartbeat/pgsql Tue Aug 31 17:01:39 2010 +0900
>> +++ b/heartbeat/pgsql Wed Sep 01 10:42:25 2010 -0600
>> @@ -229,7 +229,7 @@
>>               shift 1
>>       }
>>
>> -    ocf_run $quietrun su $OCF_RESKEY_pgdba -c "$*"
>> +    ocf_run $quietrun su $OCF_RESKEY_pgdba -c "cd $OCF_RESKEY_pgdata; $@"
>>  }
>>
>>  #
>> > _______________________________________________________
>> 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/

Reply via email to