>From Fedora 15 onwards, the init system will be systemd, which for
some reason ships with an /etc/inittab file but no actual content on
it, just some explanation of how things work with systemd. This
config will break harness_standalone, which is hoping to get a runlevel
from that file.

So, extend the checks made to include looking for /etc/systemd, and if
that path exists, assume the default runlevel is the runlevel we are in
and get info from the runlevel program output. This makes the client
to work again on F15.

Signed-off-by: Lucas Meneghel Rodrigues <l...@redhat.com>
---
 client/bin/harness_standalone.py |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/client/bin/harness_standalone.py b/client/bin/harness_standalone.py
index 75a2da9..c4b7f26 100644
--- a/client/bin/harness_standalone.py
+++ b/client/bin/harness_standalone.py
@@ -5,7 +5,7 @@ The default interface as required for the standalone reboot 
helper.
 
 __author__ = """Copyright Andy Whitcroft 2007"""
 
-from autotest_lib.client.common_lib import utils
+from autotest_lib.client.common_lib import utils, error
 import os, harness, shutil, logging
 
 class harness_standalone(harness.harness):
@@ -32,11 +32,14 @@ class harness_standalone(harness.harness):
 
         logging.info('Symlinking init scripts')
         rc = os.path.join(self.autodir, 'tools/autotest')
-        # see if system supports event.d versus inittab
-        if os.path.exists('/etc/event.d'):
+        # see if system supports event.d versus systemd versus inittab
+        supports_eventd = os.path.exists('/etc/event.d')
+        supports_systemd = os.path.exists('/etc/systemd')
+        supports_inittab = os.path.exists('/etc/inittab')
+        if supports_eventd or supports_systemd:
             # NB: assuming current runlevel is default
             initdefault = utils.system_output('/sbin/runlevel').split()[1]
-        elif os.path.exists('/etc/inittab'):
+        elif supports_inittab:
             initdefault = utils.system_output('grep :initdefault: 
/etc/inittab')
             initdefault = initdefault.split(':')[1]
         else:
-- 
1.7.4.2

_______________________________________________
Autotest mailing list
Autotest@test.kernel.org
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to