def sudo(cmd)
      cmd = "sudo #{cmd}" unless  Process.euid == 0

      RightScale::Log.info("LoginUserManager command: #{cmd}")
      output = %x(#{cmd})
      result = $?
      RightScale::Log.info("LoginUserManager result: #{$?.exitstatus}; output: #{cmd}")

      result
    end
def sudo(cmd)
      cmd = "sudo #{cmd}" unless  Process.euid == 0

      RightScale::Log.info("LoginUserManager command: #{cmd}")
      output = %x(#{cmd})
      result = $?
      RightScale::Log.info("LoginUserManager result: #{$?.exitstatus}; output: #{cmd}")

      result
    end
Run a command as root, jumping through a sudo gate if necessary.

 === Parameters
 cmd(String):: the command to execute

 === Return
 exitstatus(Process::Status):: the exitstatus of the process