LAE

Welcome to the LAE community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Discussions

Members

Resources

Events

 View Only
  • 1.  Execute System Commands - Server Status, Shutdown, Restart

    Employee
    Posted 07-25-2017 13:26

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: Brad Brezinski

    Can I use execute system command nodes like this to initiate the shutdown and restart script also referenced below?

    node:Restart_Server_2
    bretype:AppStatus_AppRestart::Execute System Command
    editor:Label=Restart Server
    editor:sortkey=566b1b2a363f12b9
    output:@4bbb5f76369e1fb0/=
    prop:Command={{%ls.brain.home%}}/bin/shutDownServer_restart
    editor:XY=90,190
    editor:Notes=This runs the script:
    editor:Notes=<installation directory>/bin/LavastormJettyServerRestart
    editor:Notes=The sever specific pathes are:
    editor:Notes=/opt/app/t1lae1c1/Lavastorm/LAE5.1/bin/LavastormJettyServerRestart
    editor:Notes=/opt/app/p1lae1c1/Lavastorm/LAE5.1/bin/LavastormJettyServerRestart
    editor:Notes=The {{%ls.brain.home%}} command runs the script regardless of the sever that is currently logged in.
    end:Restart_Server_2

    ++++++++++++++

    $cat shutDownServer_restart

    import time

    . "/opt/app/t1lae1c1/Lavastorm/LAE6.1.4/.profile.lavastorm"
    . "/opt/app/t1lae1c1/Lavastorm/LAE6.1.4/bin/stopLavastormJettyServer"
    . "/opt/app/t1lae1c1/Lavastorm/LAE6.1.4/bin/stopDatabase"
    . "/opt/app/t1lae1c1/Lavastorm/LAE6.1.4/bin/shutDownServer.sh"

    time.sleep(60)

    . "/opt/app/t1lae1c1/Lavastorm/LAE6.1.4/bin/startServer_6.1.4"


    $ cat startServer_6.1.4

    . ../.profile.lavastorm

    ./startDatabase &
    ./startLavastormJettyServer &
    ./laeServer > ../log/laeServer.log 2>&1 &


  • 2.  RE: Execute System Commands - Server Status, Shutdown, Restart

    Employee
    Posted 07-26-2017 11:08

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: stonysmith

    Here's an updated script to try:
    #!/bin/bash
    source "/opt/app/t1lae1c1/Lavastorm/LAE6.1.4/.profile.lavastorm"
    source "/opt/app/t1lae1c1/Lavastorm/LAE6.1.4/bin/stopLavastormJettyServer"
    source "/opt/app/t1lae1c1/Lavastorm/LAE6.1.4/bin/stopDatabase"
    source "/opt/app/t1lae1c1/Lavastorm/LAE6.1.4/bin/shutDownServer.sh"
    sleep(60)
    nohup startDatabase &
    nohup startLavastormJettyServer &
    nohup laeServer > ../log/laeServer.log 2>&1 &
    The three startup scripts assume that they are being executed from a command line.. they don't work right if you use the "source" (.) command in front of them. It seems to work okay for the shutdown scripts, but not the startup scripts.

    You may also need to insert some sleep() commands between the startup scripts to get the timing correct.

    The BIG problem with this approach is that the ExecSysCmd node is ALWAYS going to fail.. even if it is successful, once the LAE server exits, the node will result in a failed state.
    The way around this is to use the "at" command..
    at now -f shutDownServer_restart
    Note: if there is a problem that you are having which you are trying to solve with periodic shutdowns of LAE, then we should investigate what is causing the trouble. I've got several servers that have not needed to be restarted in six months or more, and they're running just fine.