Bug 618556 - virt-rescue return none zero value when exit
Summary: virt-rescue return none zero value when exit
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libguestfs   
(Show other bugs)
Version: unspecified
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Richard W.M. Jones
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2010-07-27 09:16 UTC by Pengzhen Cao
Modified: 2010-08-26 14:56 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2010-08-26 14:56:17 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description Pengzhen Cao 2010-07-27 09:16:09 UTC
Description of problem:
virt-rescue return none zero value when exit

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. run virt-rescue vm.img
2. wait for virt-rescue shell prompt, then run some commands in virt-rescue shell
3. type "exit"
Actual results:
virt-rescue quit with none zero stauts 10. saying" child process died unexpectedly at /usr/bin/virt-rescue line 174."

Expected results:
should return zero when exit

Additional info:
guest vm 's kernel panic is expected but I think the return code and error message should be handled more carefully.



Welcome to virt-rescue, the libguestfs rescue shell.

Note: The contents of / are the rescue appliance.
You have to mount the guest's partitions under /sysroot
before you can examine them.

bash: cannot set terminal process group (-1): Inappropriate ioctl for device
bash: no job control in this shell
><rescue> ls 
bin  etc   init  lib64	mnt  proc  sbin     sys      tmp  var
dev  home  lib	 media	opt  root  selinux  sysroot  usr
><rescue> exit

virt-rescue: Syncing the disk now before exiting ...
(Don't worry if you see a 'Kernel panic' message below)

[   16.617326] Kernel panic - not syncing: Attempted to kill init!
[   16.618514] Pid: 1, comm: init Not tainted #1
[   16.619980] Call Trace:
[   16.620552]  [<ffffffff81428cbc>] panic+0x75/0x138
[   16.621712]  [<ffffffff8104eca8>] do_exit+0x76/0x71a
[   16.622822]  [<ffffffff811bdff7>] ? security_file_permission+0x11/0x13
[   16.624294]  [<ffffffff8142dc45>] ? do_page_fault+0x2bd/0x2ed
[   16.625590]  [<ffffffff8104f3c8>] do_group_exit+0x7c/0xa6
[   16.626819]  [<ffffffff8104f404>] sys_exit_group+0x12/0x16
[   16.628125]  [<ffffffff81009b02>] system_call_fastpath+0x16/0x1b
[   16.629399] Rebooting in 1 seconds..child process died unexpectedly at /usr/bin/virt-rescue line 174.
[pcao@pcao-laptop libguestfs]$ 
[pcao@pcao-laptop libguestfs]$ echo $?

Comment 1 Richard W.M. Jones 2010-07-27 10:15:24 UTC
Yup, this is a bug ...

Comment 2 Richard W.M. Jones 2010-08-26 14:56:17 UTC
This is fixed upstream in this commit:

Note You need to log in before you can comment on or make changes to this bug.