[PATCH 08/16] Make reboot/halt/shutdown decisions in anaconda instead of loader.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 anaconda |   33 +++++++++++++++++++++++++--------
 1 files changed, 25 insertions(+), 8 deletions(-)

diff --git a/anaconda b/anaconda
index 94d6306..32f6c0f 100755
--- a/anaconda
+++ b/anaconda
@@ -914,14 +914,31 @@ if __name__ == "__main__":
     except SystemExit, code:
         anaconda.intf.shutdown()
 
-    if anaconda.ksdata and anaconda.ksdata.reboot.eject:
-        for drive in anaconda.storage.devicetree.devices:
-            if drive.type != "cdrom":
-                continue
-
-            log.info("attempting to eject %s" % drive.path)
-            drive.eject()
+        if "nokill" in flags.cmdline:
+            isys.vtActivate(1)
+            print "anaconda halting due to nokill flag."
+            print "The system will be rebooted when you press Ctrl-Alt-Delete."
+            while True:
+                time.sleep(10000)
 
-    del anaconda.intf
+    if anaconda.ksdata:
+        from pykickstart.constants import KS_SHUTDOWN, KS_WAIT, KS_REBOOT
+
+        if anaconda.ksdata.reboot.eject:
+            for drive in anaconda.storage.devicetree.devices:
+                if drive.type != "cdrom":
+                    continue
+
+                log.info("attempting to eject %s" % drive.path)
+                drive.eject()
+
+        if anaconda.ksdata.reboot.action == KS_SHUTDOWN:
+            os.system("systemctl --force --no-wall poweroff")
+        elif anaconda.ksdata.reboot.action == KS_WAIT:
+            os.system("systemctl --force --no-wall halt")
+        elif anaconda.ksdata.reboot.action == KS_REBOOT:
+            os.system("systemctl --force --no-wall reboot")
+    else:
+        os.system("systemctl --force --no-wall reboot")
 
 # vim:tw=78:ts=4:et:sw=4
-- 
1.7.4.1

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux