FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian Laptop

 
 
LinkBack Thread Tools
 
Old 04-06-2011, 08:10 PM
Chris Lumens
 
Default Make reboot/halt/shutdown decisions in anaconda instead of loader.

---
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@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 12:33 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org