aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorastokes_rhn <astokes_rhn@ef72aa8b-4018-0410-8976-d6e080ef94d8>2007-08-01 00:50:46 +0000
committerastokes_rhn <astokes_rhn@ef72aa8b-4018-0410-8976-d6e080ef94d8>2007-08-01 00:50:46 +0000
commit3de16be412eac74bc425c048ab589e6f3b0b578c (patch)
tree8a5753614bc16546d46901b81ada7cc124ac73f4 /src/lib
parente60b7c5a10a03ebca251da29f21e2eb446d3fa60 (diff)
downloadsos-3de16be412eac74bc425c048ab589e6f3b0b578c.tar.gz
some merges from trunk, updated autofs plugin to capture similar items from amd plugin and will do a simple check for global debugging and capture the needed log file for that as well.
git-svn-id: svn+ssh://svn.fedorahosted.org/svn/sos/trunk@286 ef72aa8b-4018-0410-8976-d6e080ef94d8
Diffstat (limited to 'src/lib')
-rwxr-xr-xsrc/lib/sos/policyredhat.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/lib/sos/policyredhat.py b/src/lib/sos/policyredhat.py
index cbf76d26..69c48e0f 100755
--- a/src/lib/sos/policyredhat.py
+++ b/src/lib/sos/policyredhat.py
@@ -21,10 +21,10 @@ import os
import commands
import sys
import string
+import re
from tempfile import gettempdir
from sos.helpers import *
import random
-import re
SOME_PATH = "/tmp/SomePath"
@@ -94,8 +94,15 @@ class SosPolicy:
return ret
def runlevelDefault(self):
- # FIXME: get this from /etc/inittab
- return 3
+ inittab=os.path.isfile('/etc/inittab')
+ if inittab is True:
+ f=open(inittab,'r')
+ content=f.read()
+ f.close()
+ reg=re.compile(r"^id:(\d{1}):initdefault:\D",re.MULTILINE)
+ for initlevel in reg.findall(content):
+ return initlevel
+ else: return 3
def kernelVersion(self):
return commands.getoutput("/bin/uname -r").strip("\n")