stager/lib/vcap/stager/task.rb
def return_secure_user(user)
    @logger.info("Returning user #{user} to pool")

    cmd = "sudo -u '##{user[:uid]}' pkill -9 -U #{user[:uid]}"
    kres = @runner.run_logged(cmd)
    # 0 : >=1 process matched
    # 1 : no process matched
    # 2 : error
    if kres[:status].exitstatus < 2
      @user_manager.return_user(user)

      true
    else
      @logger.warn("Failed killing processes for user #{user}")

      false
    end
  end
# Returns a secure user to the pool and kills any processes belonging to
# said user.
Returns a secure user to the pool and kills any processes belonging to
said user.
Returns a secure user to the pool and kills any processes belonging to said user .
def return_secure_user(user)
    @logger.info("Returning user #{user} to pool")
    cmd = "sudo -u '##{user[:uid]}' pkill -9 -U #{user[:uid]}"
    kres = @runner.run_logged(cmd)
    if kres[:status].exitstatus < 2
      @user_manager.return_user(user)
      true
    else
      @logger.warn("Failed killing processes for user #{user}")
      false
    end
  end
def return_secure_user ( user ) @logger . info ( "Returning user #{user} to pool" ) cmd = "sudo -u '##{user[:uid]}' pkill -9 -U #{user[:uid]}" kres = @runner . run_logged ( cmd ) if kres [ :status ] . exitstatus < 2 @user_manager . return_user ( user ) true else @logger . warn ( "Failed killing processes for user #{user}" ) false end end
Returns a secure user to the pool and kills any processes belonging to
said user.
Returns a secure user to the pool and kills any processes belonging to said user .
# 0 : >=1 process matched # 1 : no process matched # 2 : error
user