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

[Libguestfs] [PATCH 1/3] Tidy up appliance rescue code.





-- 
Richard Jones, Emerging Technologies, Red Hat  http://et.redhat.com/~rjones
Read my programming blog: http://rwmj.wordpress.com
Fedora now supports 75 OCaml packages (the OPEN alternative to F#)
http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora
>From 909b2f9d6a89aa61d3d75b7c6976ed98726de7ee Mon Sep 17 00:00:00 2001
From: Richard Jones <rjones trick home annexia org>
Date: Tue, 22 Sep 2009 19:51:47 +0100
Subject: [PATCH 1/3] Tidy up appliance rescue code.

The appliance shouldn't run the daemon after we leave the
rescue shell.  It should just exit instead.
---
 appliance/init |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/appliance/init b/appliance/init
index fe135b4..8b97590 100755
--- a/appliance/init
+++ b/appliance/init
@@ -61,7 +61,11 @@ lsmod
 # Improve virtio-blk performance (RHBZ#509383).
 for f in /sys/block/vd*/queue/rotational; do echo 1 > $f; done
 
-if grep -sq guestfs_rescue=1 /proc/cmdline; then
-  bash -i
+if ! grep -sq guestfs_rescue=1 /proc/cmdline; then
+  exec guestfsd -f
 fi
-exec guestfsd -f
+
+TERM=linux ;# XXX library should pass this from library's environment
+PS1='><rescue> '
+export TERM PS1
+exec bash -i
-- 
1.6.2.5


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