Ok I think 2. is a good solution. It is more generic and doesn't treat opensafd in any special way compared to the other init scripts that are installed on the system.

/ Anders Widell


On 06/01/2017 10:52 AM, Rafael Odzakow wrote:
1. Not possible, check my other response.

2. I am OK with that solution.


On 06/01/2017 10:33 AM, Anders Widell wrote:
Hi!

Can't you return 150 from the opensafd stop command instead? Then the caller will know that he has to retry opensafd stop. Or maybe put the retry inside the opensafd script?

/ Anders W


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