3 Replies Latest reply on Jan 7, 2014 4:26 PM by Lars Burgess

    Script the restart of RhoConnect when using dtach

    Jeffrey Cookle

      We have processes build to deploy code changes from Subversion to our RhoConnect servers using Sinatra.  I would like to create a bash script to restart RhoConnect to pick up those changes, instead of logging into those boxes directly.   It would be great if the rhoconnect restart would restart the current process and stay detached, but doesn't work that way.  Is there a way to write a bash script to stop/start rhoconnect and then detach that anyone has come across?  I would like to call that from Sinatra, if possible.

       

      I tried working with the following and didn't seem to work properly.

       

      get '/rcstop/:repos' do

        cmds = <<-END_OF_STRING

           cd #{settings.rho_projects}/#{params[:repos]}

           sudo bundle exec rhoconnect stop

           END_OF_STRING

         cmd = IO.popen(cmds)

        cmd_out = cmd.readlines

      "#{cmd_out.join}"

      end

       

      get '/rcstart/:repos' do

        cmds = <<-END_OF_STRING

          cd #{settings.rho_projects}/#{params[:repos]}

          sudo bundle exec rhoconnct start

          sleep(5)

          command /

          END_OF_STRING

          cmd = IO.popen(cmds)

          cmd_out = cmd.readlines

        "#{cmd_out.join}"

      end