Also, do the appropriate shutdown/halt/reboot kickstart action at the end of anaconda as well. --- anaconda | 31 ++++++++++++++++++++++--------- 1 files changed, 22 insertions(+), 9 deletions(-) diff --git a/anaconda b/anaconda index 785fa7e..caa6dbc 100755 --- a/anaconda +++ b/anaconda @@ -1062,19 +1062,32 @@ if __name__ == "__main__": else: kickstart.setSteps(anaconda) + rc = 0 + try: anaconda.intf.run(anaconda) except SystemExit, code: - anaconda.intf.shutdown() - - if anaconda.isKickstart and anaconda.id.ksdata.reboot.eject: - for drive in anaconda.id.storage.devicetree.devices.values(): - if drive.type != "cdrom": - continue - - log.info("attempting to eject %s" % drive.path) - drive.eject() + rc = code + anaconda.intf.shutdown() del anaconda.intf + if anaconda.isKickstart: + from pykickstart.constants import KS_HALT, KS_POWEROFF + + if anaconda.id.ksdata.reboot.eject: + for drive in anaconda.id.storage.devicetree.getDevicesByType("cdrom"): + log.info("attempting to eject %s" % drive.path) + drive.eject() + + # Only perform these actions if anaconda properly finished up. The + # default action for anaconda is to reboot, so we don't need to do + # that here. + if rc == 0 and anaconda.id.ksdata.reboot.action == KS_HALT: + iutil.execWithRedirect("halt", [], searchPath=1) + elif rc == 0 and anaconda.id.ksdata.reboot.action == KS_POWEROFF: + iutil.execWithRedirect("poweroff", [], searchPath=1) + + sys.exit(rc) + # vim:tw=78:ts=4:et:sw=4 -- 1.6.5.1 _______________________________________________ Anaconda-devel-list mailing list Anaconda-devel-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/anaconda-devel-list