Exemplo n.º 1
0
def checkSELinux():
  if ENV_IGNORE_SELINUX in os.environ:
    comm.out("Skipping SELinux check (to enable this check, unset the '%s' environment variable)." % ENV_IGNORE_SELINUX)
  else:
    if os.path.exists(PATH_SELINUX_CONFIG):
      comm.out("\tChecking for SELinux.")
      if "enforcing" in comm.sed("^SELINUX=(.*)", "\\1", PATH_SELINUX_CONFIG):
        raise cex.ArgError, "Splunk will not run with SELinux enabled.\nIf you have adjusted Splunk's security level with chcon, you can bypass this check by setting the '%s' environment variable." % ENV_IGNORE_SELINUX
Exemplo n.º 2
0
def checkSELinux():
  if ENV_IGNORE_SELINUX in os.environ:
    comm.out("Skipping SELinux check (to enable this check, unset the '%s' environment variable)." % ENV_IGNORE_SELINUX)
  else:
    if os.path.exists(PATH_SELINUX_CONFIG):
      comm.out("\tChecking for SELinux.")
      if "enforcing" in comm.sed("^SELINUX=(.*)", "\\1", PATH_SELINUX_CONFIG):
        raise cex.ArgError, "Splunk will not run with SELinux enabled.\nIf you have adjusted Splunk's security level with chcon, you can bypass this check by setting the '%s' environment variable." % ENV_IGNORE_SELINUX
Exemplo n.º 3
0
def promptLicense():
  if not comm.isWindows: # windows will probably display its license in the installer.
    if os.path.exists(PATH_LICENSE_FILE):
      if sys.stdin.isatty():
        subprocess.call(["more", PATH_LICENSE_FILE]) # TODO: test this on dirs w/ spaces.  prob works fine.
      else:
        logger.info(open(PATH_LICENSE_FILE, 'r').read())
    else: # don't barf in dev envs
      comm.out("Could not find license file.")
    if not comm.prompt_user("Do you agree with this license? [y/n]: ", checkValidResponse = True):
      raise cex.InputError("License refused - exiting.")
Exemplo n.º 4
0
def promptLicense():
  if not comm.isWindows: # windows will probably display its license in the installer.
    if os.path.exists(PATH_LICENSE_FILE):
      if sys.stdin.isatty():
        subprocess.call(["more", PATH_LICENSE_FILE]) # TODO: test this on dirs w/ spaces.  prob works fine.
      else:
        logger.info(open(PATH_LICENSE_FILE, 'r').read())
    else: # don't barf in dev envs
      comm.out("Could not find license file.")
    if not comm.prompt_user("Do you agree with this license? [y/n]: ", checkValidResponse = True):
      raise cex.InputError("License refused - exiting.")