Bug 661280 - virt-rescue: panic when shutting down: "/sbin/reboot: No such file or directory"
virt-rescue: panic when shutting down: "/sbin/reboot: No such file or directory"
Status: CLOSED UPSTREAM
Product: Virtualization Tools
Classification: Community
Component: libguestfs (Show other bugs)
unspecified
Unspecified Unspecified
low Severity medium
: ---
: ---
Assigned To: Richard W.M. Jones
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-12-08 06:59 EST by Richard W.M. Jones
Modified: 2011-07-13 09:29 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-07-13 09:29:08 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Richard W.M. Jones 2010-12-08 06:59:11 EST
Description of problem:

When virt-rescue exits, it looks for /sbin/reboot and doesn't
find it, causing a panic:

><rescue> exit

virt-rescue: Syncing the disk now before exiting ...

/init: line 120: /sbin/reboot: No such file or directory
[   67.638939] Kernel panic - not syncing: Attempted to kill init!
[   67.642200] Pid: 1, comm: init Not tainted 2.6.35.9-64.fc14.x86_64 #1
[   67.643740] Call Trace:
[   67.644221]  [<ffffffff81467b09>] panic+0x8b/0x10d
[   67.645085]  [<ffffffff810d0dbc>] ? perf_event_exit_task+0x27/0x11e
[   67.645733]  [<ffffffff81050e7a>] do_exit+0x7b/0x73d
[   67.646557]  [<ffffffff811dc3dd>] ? security_file_permission+0x16/0x18
[   67.647567]  [<ffffffff8146ccd0>] ? do_page_fault+0x238/0x265
[   67.648410]  [<ffffffff810517b6>] do_group_exit+0x7a/0xa2
[   67.649102]  [<ffffffff810517f5>] sys_exit_group+0x17/0x1b
[   67.649672]  [<ffffffff81009cf2>] system_call_fastpath+0x16/0x1b

This doesn't affect normal operation, but is unsightly.

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

1.7.20

How reproducible:

Always.

Steps to Reproduce:
1. virt-rescue /dev/null
2. At the ><rescue> prompt type 'exit'
  
Actual results:

Error messages above.

Expected results:

Should reboot cleanly.

Additional info:
Comment 1 Richard W.M. Jones 2010-12-19 06:03:34 EST
Fixed upstream.

virt-rescue now says:

><rescue> exit

virt-rescue: Syncing the disk now before exiting ...

[    5.408459] md: stopping all md devices.
[    6.410490] Restarting system.
[    6.410815] machine restart
Comment 2 Josh Stone 2011-06-15 19:51:51 EDT
This seems to have regressed, using libguestfs-1.10.3-1.fc15.x86_64:

$ virt-rescue /dev/null
[...]
><rescue> exit

virt-rescue: Syncing the disk now before exiting ...

/init: line 125: /sbin/reboot: No such file or directory
[    2.314040] Kernel panic - not syncing: Attempted to kill init!
[    2.315094] Pid: 1, comm: init Not tainted 2.6.38.7-30.fc15.x86_64 #1
[    2.316227] Call Trace:
[    2.316674]  [<ffffffff8146c685>] panic+0x91/0x19c
[    2.317496]  [<ffffffff81058499>] do_exit+0x7c/0x732
[    2.318403]  [<ffffffff81058dd4>] do_group_exit+0x7a/0xa2
[    2.319378]  [<ffffffff81058e13>] __wake_up_parent+0x0/0x28
[    2.320383]  [<ffffffff81009bc2>] system_call_fastpath+0x16/0x1b
[    2.321518] Rebooting in 1 seconds..virt-rescue: child process died unexpectedly


It may be relevant that on F15, /sbin/reboot is a symlink -> ../bin/systemctl.  Neither that symlink nor systemctl appear in the rescue environment.
Comment 3 Richard W.M. Jones 2011-06-16 03:48:23 EDT
Setting back to ASSIGNED.  I had a brief look at this
a while back, but I couldn't work out what magic packages
needed to be added to get reboot to work.

Note that this warning is entirely harmless.  The disk
is still synced!
Comment 4 Richard W.M. Jones 2011-07-13 09:29:08 EDT
I added this patch in 1.11.16:

http://git.annexia.org/?p=libguestfs.git;a=commitdiff;h=aa8a9ebf29b7fdc97467e911560a1a7a774e9e1f

The output of virt-rescue at exit is now:

-----------

virt-rescue: Syncing the disk now before exiting ...

Rebooting.
[    3.007450] md: stopping all md devices.
[    4.011515] Restarting system.
[    4.011806] machine restart
virt-rescue: child process died unexpectedly

-----------

The final message is a different issue.

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