On Thu, Mar 21, 2013 at 12:18 AM, Bruno Cornec <[email protected]> wrote:
> We have an opened bug report (Cf:
> http://trac.mondorescue.org/ticket/627) concerning the restoration
> phasebase don busybox, where a user is supposed to be able to press
> CTRL-ALT-DEL in order to reboot the computer before launching an
> automatic restore. This is not working as expected.
>
> We are up to now using version 1.18.5, with the attached .config file to
> compile busybox. We have an inittab file containing:
>
> #
> # inittab       This file describes how the INIT process should set up
> #               the system in the mindi-busybox context
> #
>
> # Order is important, read from bottom to top
>
> # By default launch the MondoRescue script
> console::sysinit:/etc/init.d/rcS
>
> console::restart:/sbin/init
>
> # Trap CTRL-ALT-DELETE
> null::ctrlaltdel:/sbin/reboot
>
> null::shutdown:/bin/killall klogd
> null::shutdown:/bin/killall syslogd
> null::shutdown:/bin/umount -a -r
>
> I'm testing mostly on KVM VMs, and simulate the CTRL-ALT-DEL with the
> sendkey command from the monitor window. This is working when we are at
> syslinux boot prompt, but as soon as we launch init, then we are unable
> to reboot the VM using CTRL-ALT-DEL. I also tested on real HW with the
> same result.
>
> So I'm surely doing something wrong, either in my inittab or in my
> congif of busybox, but I don't see what.
>
> I even tried with the latest 1.20.2 (which I may use as the base for the
> next stable version) without more luck either.
>
> Using showkey in the VM, I see that the sendkey command does indeed send
> the keys to the system, but it doesn't generate the reboot. I attached
> the corresponding capture.
>
> I read at
> http://lists.busybox.net/pipermail/busybox/2012-May/077855.html that a
> reason could be a non-busybox reboot but that's not our case. While we
> do replace some busybox commands by the native ones, reboot is linked to
> busybox (as well as halt, but not shutdown, which I just remarked
> now,but linking it to busybox doesn't change stuff anyway).
>
> So I'm looking for advises on how to debug more, or any hint wrt my
> usage.

Pressing CTRL-ALT-DEL sends SIGINT signal to process 1.
You want to make sure it reaches it.

The handler is installed here in init.c:

                /* SIGINT (Ctrl-Alt-Del) must interrupt wait(),
                 * setting handler without SA_RESTART flag.
                 */
                bb_signals_recursive_norestart((1 << SIGINT), record_signo);

You can write a my_record_signo() function which also prints
signal number on stdout.

Then, you may want to similarly check whether this location
is reached in check_delayed_sigs():

                if (sig == SIGINT)
                        run_actions(CTRLALTDEL);

-- 
vda
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to