Again, opensaf status returns either 0 "opensaf system is running" or 3 
"opensaf system is not running".
As I also commented before, what is the problem you are trying to solve? If SMF 
orders reboot and 
opensaf stop fails the node will be rebooted anyway, you replied ... " opensafd 
but from services that can not handle a abrupt reboot."
Which services are you referring to? The system may be abrubtly rebooted at any 
time.

 /Hans

-----Original Message-----
From: Rafael Odzakow 
Sent: den 1 juni 2017 10:41
To: Hans Nordebäck <hans.nordeb...@ericsson.com>; Anders Widell 
<anders.wid...@ericsson.com>
Cc: opensaf-devel@lists.sourceforge.net
Subject: Re: [PATCH 1/1] base: Improve state report for opensafd [#2459]

This "definition" is flawed.


opensafd stop is issued by the system when a node receives the reboot command. 
It is not directly called by SMF.

As the issuer of the reboot command SMF needs to know if the stop is possible 
to execute because a prior start might still be ongoing.

With your suggestion Hans SMF would also find out the status of AMF pid and 
amf-status command. I do not like to drag in unnecessary dependencies.



On 05/31/2017 01:59 PM, Hans Nordebäck wrote:
> opensafd status reports if opensaf is running or not. There is a 
> "window" from where amfnd is up and til the
>
> "lockfile_inprogress" is removed. This "window" is handled with the 
> suggested change.
>
> The definition of a running opensaf is that amfnd is running and now 
> also that
>
> the "lockfile_inprogress" file does not exist. If amfnd stops running 
> the node will immediately be rebooted.
>
> It is not necessary to check all services.
>
> /Hans
>
>
>
> On 05/31/2017 01:35 PM, Rafael Odzakow wrote:
>> I don't agree with this suggestion having AMF in the status report of 
>> opensafd init script does not fit in here. AMF is not OpenSAF it is 
>> only a subset.
>>
>> - Either have all services report status, or
>>
>> - Have only the init script reports it internal status
>>
>> The patch is avoiding this issue by creating a new return code 
>> because a real solution would be NBC. But as this script is pretty 
>> central to OpenSAF I am thinḱing NBC route would be better.
>>
>>
>> On 05/31/2017 12:42 PM, Hans Nordebäck wrote:
>>> Hi Rafael,
>>>
>>> not tested, but perhaps we can do this check instead?:
>>>
>>> status() {
>>>
>>>     amfpid=`pidofproc -p $amfnd_pid $amfnd_bin`
>>>
>>>         if [[ -n "$amfpid" && ! -f "$lockfile_inprogress" ]; then
>>>         amf-state siass ha
>>>         RETVAL=$?
>>>     else
>>>         echo "The OpenSAF HA Framework is not running"
>>>         RETVAL=3
>>>     fi
>>>
>>>     return $RETVAL
>>> }
>>>
>>> /Hans
>>>
>>>
>>> On 05/19/2017 12:46 PM, Rafael Odzakow wrote:
>>>> Internally opensafd creates a lock file during start/stop to avoid
>>>> parallel execution. To allow others to query the state this ticket 
>>>> will
>>>> use the opensafd lockfile to report the status of start/stop when
>>>> requested with "opensafd status"
>>>> ---
>>>>   src/nid/opensafd.in | 8 +++++++-
>>>>   1 file changed, 7 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/src/nid/opensafd.in b/src/nid/opensafd.in
>>>> index e7683bd7e..c93cca7e1 100644
>>>> --- a/src/nid/opensafd.in
>>>> +++ b/src/nid/opensafd.in
>>>> @@ -326,8 +326,14 @@ forcereload() {
>>>>   }
>>>>     status() {
>>>> +
>>>>       amfpid=`pidofproc -p $amfnd_pid $amfnd_bin`
>>>> -    if [ -n "$amfpid" ]; then
>>>> +
>>>> +    if [ -e "$lockfile_inprogress" ]; then
>>>> +                echo "Lockfile taken, OpenSAF start/stop is in 
>>>> progress"
>>>> +                # LSB defines 150-199 as application reserved exit 
>>>> codes
>>>> +                RETVAL=150
>>>> +        elif [ -n "$amfpid" ]; then
>>>>           amf-state siass ha
>>>>           RETVAL=$?
>>>>       else
>>>
>>
>>
>


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to