AppController/djinn.rb
# A SOAP-exposed method that tells the AppController to terminate all services
# in this AppScale deployment.
#
# Args:
#   stop_deployment: A boolean to indicate if the whole deployment
#                    should be stopped.
#   secret         : A String used to authenticate callers.
# Returns:
#   A String indicating that the termination has started, or the reason why it
#   failed.
A SOAP-exposed method that tells the AppController to terminate all services
in this AppScale deployment.

A boolean to indicate if the whole deployment
should be stopped.
secret         : A String used to authenticate callers.
Returns:
A String indicating that the termination has started, or the reason why it
failed.
A SOAP - exposed method that tells the AppController to terminate all services in this AppScale deployment . A boolean to indicate if the whole deployment should be stopped . secret : A String used to authenticate callers . Returns : A String indicating that the termination has started or the reason why it failed .
def kill(stop_deployment, secret)
    begin
      return BAD_SECRET_MSG unless valid_secret?(secret)
    rescue Errno::ENOENT
      Djinn.log_debug("kill(): didn't find secret file. Continuing.")
    end
    @kill_sig_received = true
    Djinn.log_info("Received a stop request.")
    if my_node.is_shadow? and stop_deployment
      Djinn.log_info("Stopping all other nodes.")
      threads << Thread.new {
        @nodes.each { |node|
          if node.private_ip != my_node.private_ip
            acc = AppControllerClient.new(ip, @@secret)
            begin
              acc.kill(stop_deployment)
              Djinn.log_info("kill: sent kill command to node at #{ip}.")
            rescue FailedNodeException
              Djinn.log_warn("kill: failed to talk to node at #{ip} while.")
            end
          end
        }
      }
    end
    if @options['alter_etc_resolv'].downcase == "true"
      HelperFunctions.restore_etc_resolv()
    end
    Djinn.log_info("---- Stopping AppController ----")
    return "OK"
  end
def kill ( stop_deployment , secret ) begin return BAD_SECRET_MSG unless valid_secret? ( secret ) rescue Errno :: ENOENT Djinn . log_debug ( "kill(): didn't find secret file. Continuing." ) end @kill_sig_received = true Djinn . log_info ( "Received a stop request." ) if my_node . is_shadow? and stop_deployment Djinn . log_info ( "Stopping all other nodes." ) threads << Thread . new { @nodes . each { | node | if node . private_ip != my_node . private_ip acc = AppControllerClient . new ( ip , @@secret ) begin acc . kill ( stop_deployment ) Djinn . log_info ( "kill: sent kill command to node at #{ip}." ) rescue FailedNodeException Djinn . log_warn ( "kill: failed to talk to node at #{ip} while." ) end end } } end if @options [ 'alter_etc_resolv' ] . downcase == "true" HelperFunctions . restore_etc_resolv ( ) end Djinn . log_info ( "---- Stopping AppController ----" ) return "OK" end
A SOAP-exposed method that tells the AppController to terminate all services
in this AppScale deployment.
A SOAP - exposed method that tells the AppController to terminate all services in this AppScale deployment .
# On appscale down, terminate may delete our secret key before we # can check it here. # Let's stop all other nodes.
stop_deployment
<not_specific>
secret
<not_specific>