source/code/plugins/agent_maintenance_script.rb
# Return true if the user should be running this script (root or omsagent or testing)
Return true if the user should be running this script (root or omsagent or testing)
Return true if the user should be running this script ( root or omsagent or testing )
def check_user
      if (!ENV["TEST_WORKSPACE_ID"].nil? or !ENV["TEST_SHARED_KEY"].nil?) or
          (is_current_user_root or Etc.getpwuid(Process.euid).name == @AGENT_USER)
        return true
      else
        log_error("This script must be run as root or as the #{@AGENT_USER} user.")
        return false
      end
    end
def check_user if ( ! ENV [ "TEST_WORKSPACE_ID" ] . nil? or ! ENV [ "TEST_SHARED_KEY" ] . nil? ) or ( is_current_user_root or Etc . getpwuid ( Process . euid ) . name == @AGENT_USER ) return true else log_error ( "This script must be run as root or as the #{@AGENT_USER} user." ) return false end end
Return true if the user should be running this script (root or omsagent or testing)
Return true if the user should be running this script ( root or omsagent or testing )