OFBiz
  1. OFBiz
  2. OFBIZ-4775

add a status target to build.xml for getting the status of Ofbiz

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: Trunk
    • Fix Version/s: None
    • Component/s: framework
    • Labels:
      None

      Description

      Hi

      This is a minor new target for getting the status of the ofbiz server.

      Rgds

        Activity

        Hide
        Jacques Le Roux added a comment -

        Hi Francis,

        This is ambiguous because it will not work on Windows (even if I'm sure few people use Windows servers)... Also a typo: statuc
        2 possiblities:

        1. add the same in startofbiz.bat (ie
          ADMIN_PORT=10523
          ADMIN_KEY=so3du5kasd5dn
          ADMIN="-Dofbiz.admin.port=$ADMIN_PORT -Dofbiz.admin.key=$ADMIN_KEY"
        2. Change the description to ="Display status of OFBiz when running in Unix like platform">
        Show
        Jacques Le Roux added a comment - Hi Francis, This is ambiguous because it will not work on Windows (even if I'm sure few people use Windows servers)... Also a typo: statuc 2 possiblities: add the same in startofbiz.bat (ie ADMIN_PORT=10523 ADMIN_KEY=so3du5kasd5dn ADMIN="-Dofbiz.admin.port=$ADMIN_PORT -Dofbiz.admin.key=$ADMIN_KEY" Change the description to ="Display status of OFBiz when running in Unix like platform">
        Hide
        Francis ANDRE added a comment -

        it works on WXP at least

        Z:\ERP\ofbiz>ant status

        Z:\ERP\ofbiz>ECHO OFF

        Z:\ERP\ofbiz>"C:\Program Files\Java\jdk1.6.0_30\bin\java" -jar framework/base/lib/ant-launcher-1.8.2.jar -lib framework/base/lib/ant
        status
        Buildfile: Z:\ERP\ofbiz\build.xml
        Trying to override old definition of task for
        Trying to override old definition of task for

        status:
        [java] debug: args=[-status]
        [java] debug: command=STATUS
        [java] debug: loaderArgs=[]
        [java] Start.java using configuration file org/ofbiz/base/start/start.properties
        [java] Set OFBIZ_HOME to - Z:/ERP/ofbiz
        [java] Current Status : Running

        BUILD SUCCESSFUL
        Total time: 1 second
        Z:\ERP\ofbiz>

        startofbiz.bat is no more available in the svn trunk and I do not why...

        Show
        Francis ANDRE added a comment - it works on WXP at least Z:\ERP\ofbiz>ant status Z:\ERP\ofbiz>ECHO OFF Z:\ERP\ofbiz>"C:\Program Files\Java\jdk1.6.0_30\bin\java" -jar framework/base/lib/ant-launcher-1.8.2.jar -lib framework/base/lib/ant status Buildfile: Z:\ERP\ofbiz\build.xml Trying to override old definition of task for Trying to override old definition of task for status: [java] debug: args= [-status] [java] debug: command=STATUS [java] debug: loaderArgs=[] [java] Start.java using configuration file org/ofbiz/base/start/start.properties [java] Set OFBIZ_HOME to - Z:/ERP/ofbiz [java] Current Status : Running BUILD SUCCESSFUL Total time: 1 second Z:\ERP\ofbiz> startofbiz.bat is no more available in the svn trunk and I do not why...
        Hide
        Francis ANDRE added a comment -

        by the way, if startofbiz.sh and stopofbiz.sh are available then startofbiz.bat and stopofbiz.bat should also be available. I do not see why Unix like boxes should be first class citizen while Windows boxes not....

        Show
        Francis ANDRE added a comment - by the way, if startofbiz.sh and stopofbiz.sh are available then startofbiz.bat and stopofbiz.bat should also be available. I do not see why Unix like boxes should be first class citizen while Windows boxes not....
        Hide
        Jacques Le Roux added a comment -

        This is what I get running ant status if I launch OFBiz using ant run:

        D:\workspace\ofbizClean>"C:\Program Files\Java\jdk1.6.0_22\bin\java" -jar framework/base/lib/ant-launcher-1.8.2.jar -lib framework/base/lib/ant status
        Buildfile: D:\workspace\ofbizClean\build.xml
        
        status:
             [java] debug: args=[-status]
             [java] debug: command=STATUS
             [java] debug: loaderArgs=[]
             [java] Start.java using configuration file org/ofbiz/base/start/start.properties
             [java] Set OFBIZ_HOME to - D:/workspace/ofbizClean
             [java] Current Status : Running
        
        BUILD SUCCESSFUL
        Total time: 1 second
        D:\workspace\ofbizClean>
        

        But this is what I get running OFBiz using /tools/startofbiz.bat

        D:\workspace\ofbizClean>"C:\Program Files\Java\jdk1.6.0_22\bin\java" -jar framework/base/lib/ant-launcher-1.8.2.jar -lib framework/base/lib/ant status
        Buildfile: D:\workspace\ofbizClean\build.xml
        
        status:
             [java] Start.java using configuration file org/ofbiz/base/start/start.properties
             [java] Set OFBIZ_HOME to - D:/workspace/ofbizClean
             [java] debug: args=[-status]
             [java] debug: command=STATUS
             [java] debug: loaderArgs=[]
             [java] Could not connect to /127.0.0.1:10523
             [java] Current Status : OFBiz is Down
        
        BUILD SUCCESSFUL
        Total time: 2 seconds
        

        Hence my concern about consistency.

        Now about startofbiz.bat, here is the history and the reasons of this other inconsistency:

        1. Jacopo decided to move scripts and such from OFBiz root to the tools folder. In the same time he changed the code inside the start/stopofbiz.sh scripts
        2. Hans decided it was not good for start/stopofbiz.sh scripts because he needed them in root (seems that adding /tools before was too much an effort,not sure why...). So he moved back the start/stopofbiz.sh from tools to root and removed the changes in scripts.
        3. Jacopo asked Hans to revert his changes
        4. Finally Hans said he reverted his changes at r1304965. But he actually reverted only the changes inside the scripts and kept them at root.

        So we ended with this platforms inconsistency. Only a vote could decide about these changes but not sure the community is really worried about that...

        Show
        Jacques Le Roux added a comment - This is what I get running ant status if I launch OFBiz using ant run : D:\workspace\ofbizClean> "C:\Program Files\Java\jdk1.6.0_22\bin\java" -jar framework/base/lib/ant-launcher-1.8.2.jar -lib framework/base/lib/ant status Buildfile: D:\workspace\ofbizClean\build.xml status: [java] debug: args=[-status] [java] debug: command=STATUS [java] debug: loaderArgs=[] [java] Start.java using configuration file org/ofbiz/base/start/start.properties [java] Set OFBIZ_HOME to - D:/workspace/ofbizClean [java] Current Status : Running BUILD SUCCESSFUL Total time: 1 second D:\workspace\ofbizClean> But this is what I get running OFBiz using /tools/startofbiz.bat D:\workspace\ofbizClean> "C:\Program Files\Java\jdk1.6.0_22\bin\java" -jar framework/base/lib/ant-launcher-1.8.2.jar -lib framework/base/lib/ant status Buildfile: D:\workspace\ofbizClean\build.xml status: [java] Start.java using configuration file org/ofbiz/base/start/start.properties [java] Set OFBIZ_HOME to - D:/workspace/ofbizClean [java] debug: args=[-status] [java] debug: command=STATUS [java] debug: loaderArgs=[] [java] Could not connect to /127.0.0.1:10523 [java] Current Status : OFBiz is Down BUILD SUCCESSFUL Total time: 2 seconds Hence my concern about consistency. Now about startofbiz.bat, here is the history and the reasons of this other inconsistency: Jacopo decided to move scripts and such from OFBiz root to the tools folder. In the same time he changed the code inside the start/stopofbiz.sh scripts Hans decided it was not good for start/stopofbiz.sh scripts because he needed them in root (seems that adding /tools before was too much an effort,not sure why...). So he moved back the start/stopofbiz.sh from tools to root and removed the changes in scripts. Jacopo asked Hans to revert his changes Finally Hans said he reverted his changes at r1304965 . But he actually reverted only the changes inside the scripts and kept them at root. So we ended with this platforms inconsistency. Only a vote could decide about these changes but not sure the community is really worried about that...
        Hide
        Jacques Le Roux added a comment -

        In other words, Hans's comment on r1304965

        reverting revision 1304679 and 1304687, however leaving the original startofbiz.sh and stopofbiz.sh in the root deirectory, this in order not to block furher development

        is also inconsistent because he actually reverted only r1304687. Saying "Reverting r1304679" and saying "however leaving the original startofbiz.sh and stopofbiz.sh in the root deirectory, this in order not to block furher development" is inconsistent (or dishonest). I did not check, relying on the comment I thought that temporary copies was kept in root until the changes were done on his end. I discovered today it was not, a least so far...

        Show
        Jacques Le Roux added a comment - In other words, Hans's comment on r1304965 reverting revision 1304679 and 1304687, however leaving the original startofbiz.sh and stopofbiz.sh in the root deirectory, this in order not to block furher development is also inconsistent because he actually reverted only r1304687. Saying "Reverting r1304679" and saying "however leaving the original startofbiz.sh and stopofbiz.sh in the root deirectory, this in order not to block furher development" is inconsistent (or dishonest). I did not check, relying on the comment I thought that temporary copies was kept in root until the changes were done on his end. I discovered today it was not, a least so far...
        Hide
        Hans Bakker added a comment -

        Jacques, do not call me dishonest? I make errors but this is implying i do it on purpose and that is certainly not the case.

        Show
        Hans Bakker added a comment - Jacques, do not call me dishonest? I make errors but this is implying i do it on purpose and that is certainly not the case.
        Hide
        Jacopo Cappellato added a comment -

        Jacques,

        the reason for the fact that "status" doesn't work when OFBiz is started from tools/startofbiz.bat is because startofbiz.bat doesn't set the admin port/key as it happens with Unix commands.
        This lack in startofbiz.bat file was not caused by the move to the "tools" folder. Itshould be very easy to fix this by enhancing the tools/startofbiz.bat (copying from startofbiz.sh).

        Show
        Jacopo Cappellato added a comment - Jacques, the reason for the fact that "status" doesn't work when OFBiz is started from tools/startofbiz.bat is because startofbiz.bat doesn't set the admin port/key as it happens with Unix commands. This lack in startofbiz.bat file was not caused by the move to the "tools" folder. Itshould be very easy to fix this by enhancing the tools/startofbiz.bat (copying from startofbiz.sh).
        Hide
        Francis ANDRE added a comment -

        The ADMIN port/key can also be setup in the start.properties as
        ofbiz.admin.host=127.0.0.1
        ofbiz.admin.port=10523
        ofbiz.admin.key=so3du5kasd5dn

        Show
        Francis ANDRE added a comment - The ADMIN port/key can also be setup in the start.properties as ofbiz.admin.host=127.0.0.1 ofbiz.admin.port=10523 ofbiz.admin.key=so3du5kasd5dn
        Hide
        Jacques Le Roux added a comment -

        Hans, thanks for clarifying, I thought you also did not spot this, and should have added a question mark inside the parentheses.
        Jacopo, yes I know (I'm used to change the admin key value in Linux scripts ;o) just wanted to make this clear.
        Francis, then please complete your patch.

        Thanks to all

        Show
        Jacques Le Roux added a comment - Hans, thanks for clarifying, I thought you also did not spot this, and should have added a question mark inside the parentheses. Jacopo, yes I know (I'm used to change the admin key value in Linux scripts ;o) just wanted to make this clear. Francis, then please complete your patch. Thanks to all
        Hide
        Jacques Le Roux added a comment -

        Francis, it's of course also needed in stop

        Hans, oops my apologizes, I just realise now that this comment is totally wrong

        Finally Hans said he reverted his changes at r1304965. But he actually reverted only the changes inside the scripts and kept them at root.

        when you actually re-added the modified startofbiz.sh and stopofbiz.sh in root at r1304965, very embarrassing, excuse my mistake.

        Still we have these duplicate filenames and different scripts, will this continue?

        Show
        Jacques Le Roux added a comment - Francis, it's of course also needed in stop Hans, oops my apologizes, I just realise now that this comment is totally wrong Finally Hans said he reverted his changes at r1304965. But he actually reverted only the changes inside the scripts and kept them at root. when you actually re-added the modified startofbiz.sh and stopofbiz.sh in root at r1304965, very embarrassing, excuse my mistake. Still we have these duplicate filenames and different scripts, will this continue?
        Hide
        Jacopo Cappellato added a comment -

        I am going to clean them with the other changes I did to task names etc... Everyone had enough time to comment and view the changes and so the impact on external systems should be low.

        Jacopo

        Show
        Jacopo Cappellato added a comment - I am going to clean them with the other changes I did to task names etc... Everyone had enough time to comment and view the changes and so the impact on external systems should be low. Jacopo
        Hide
        Jacopo Cappellato added a comment -

        Thank you Francis, your patch is in rev. 1308377

        Show
        Jacopo Cappellato added a comment - Thank you Francis, your patch is in rev. 1308377
        Hide
        Francis ANDRE added a comment -

        Hi Jacopo

        IMHO, the ADMIN port/key should be set only in the start.properties and removed from all .bat and .sh scripts because, if one day soneone chooses to change the port or the password key, it would have to change them in more than 8 scripts while they could be change in a single place in the start.properties.

        ofbiz.admin.port=10523
        ofbiz.admin.key=so3du5kasd5dn

        Show
        Francis ANDRE added a comment - Hi Jacopo IMHO, the ADMIN port/key should be set only in the start.properties and removed from all .bat and .sh scripts because, if one day soneone chooses to change the port or the password key, it would have to change them in more than 8 scripts while they could be change in a single place in the start.properties. ofbiz.admin.port=10523 ofbiz.admin.key=so3du5kasd5dn
        Hide
        Jacopo Cappellato added a comment -

        Hi Francis,

        I probably agree with you; would you mind starting this conversation in the dev list?

        Jacopo

        Show
        Jacopo Cappellato added a comment - Hi Francis, I probably agree with you; would you mind starting this conversation in the dev list? Jacopo
        Hide
        Jacques Le Roux added a comment -

        Hi Francis,

        Good idea. To complete/explain Jacopo's request: we decided some years ago it's better to discuss/share new ideas, wishes, etc. in a new thread in dev ML before opening a new Jira or adding in one.

        Thanks

        Show
        Jacques Le Roux added a comment - Hi Francis, Good idea. To complete/explain Jacopo's request: we decided some years ago it's better to discuss/share new ideas, wishes, etc. in a new thread in dev ML before opening a new Jira or adding in one. Thanks
        Hide
        Francis ANDRE added a comment -

        Hi jacques

        But this is not a new idea. It is directly related to this issue, it is related to your first comment no adding the ADMIN port/key in the .bat and .sh scripts.

        FA

        Show
        Francis ANDRE added a comment - Hi jacques But this is not a new idea. It is directly related to this issue, it is related to your first comment no adding the ADMIN port/key in the .bat and .sh scripts. FA
        Hide
        Jacques Le Roux added a comment -

        Hi Francis,

        Yes, don't get me wrong, it was just to generally explain this point of our "best practices" which, I thought, could maybe not be obvious to you.

        Show
        Jacques Le Roux added a comment - Hi Francis, Yes, don't get me wrong, it was just to generally explain this point of our "best practices" which, I thought, could maybe not be obvious to you.

          People

          • Assignee:
            Jacopo Cappellato
            Reporter:
            Francis ANDRE
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development