Re: [devel] [PATCH 1/1] base: Improve state report for opensafd [#2459]

2017-05-31 Thread Hans Nordebäck
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


Re: [devel] [PATCH 1/1] base: Improve state report for opensafd [#2459]

2017-05-31 Thread Rafael Odzakow
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