Tidy up appliance rescue code.
authorRichard Jones <rjones@trick.home.annexia.org>
Tue, 22 Sep 2009 18:51:47 +0000 (19:51 +0100)
committerRichard Jones <rjones@trick.home.annexia.org>
Wed, 23 Sep 2009 10:18:45 +0000 (11:18 +0100)
The appliance shouldn't run the daemon after we leave the
rescue shell.  It should just exit instead.

appliance/init

index fe135b4..8b97590 100755 (executable)
@@ -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