From: parmentelat <thierry.parmentelat@inria.fr>
Date: Tue, 18 Dec 2018 08:23:01 +0000 (+0100)
Subject: service and ifconfig have gone
X-Git-Tag: bootmanager-6.0-0~9
X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=f34ef1af6e4ba70e19c943ac3ef388675998b3f8;p=bootmanager.git

service and ifconfig have gone
---

diff --git a/source/steps/ChainBootNode.py b/source/steps/ChainBootNode.py
index 1282542..995d4ea 100644
--- a/source/steps/ChainBootNode.py
+++ b/source/steps/ChainBootNode.py
@@ -236,7 +236,8 @@ def Run(vars, log):
     # there are a few buggy drivers that don't disable their hardware
     # correctly unless they are first unloaded.
 
-    utils.sysexec_noerr("ifconfig eth0 down", log)
+    utils.sysexec_noerr("ifconfig eth0 down || /usr/libexec/nm-ifdown eth0",
+                        log, shell=True)
 
     utils.sysexec_noerr("killall dhclient", log)
 
diff --git a/source/steps/StartDebug.py b/source/steps/StartDebug.py
index 598121f..f913dc8 100644
--- a/source/steps/StartDebug.py
+++ b/source/steps/StartDebug.py
@@ -120,7 +120,8 @@ def Run(vars, log, last_resort = True):
     # start sshd
     if not os.path.isfile(sshd_started_flag):
         log.write("Starting sshd\n")
-        utils.sysexec("service sshd start", log)
+        utils.sysexec("service sshd start || systemctl start sshd",
+                      log, shell=True)
         # flag that ssh is running
         utils.sysexec("touch {}".format(sshd_started_flag), log)
     else: