[Bug 12071] Busybox reboot command not working in version 1.29.3

bugzilla at busybox.net bugzilla at busybox.net
Wed Nov 27 05:56:51 UTC 2019


https://bugs.busybox.net/show_bug.cgi?id=12071

--- Comment #6 from Krishna <muppakrishna1 at gmail.com> ---
(In reply to Denys Vlasenko from comment #5)

Thank you for the update.

It looks the ps id belongs to rcS.

root at Charter-WB:/# strace -s99 -p 1 &
root at Charter-WB:/# Process 1 attached - interrupt to quit
wait4(-1, busybox reboot
NULL, 0, NULL)                = ? ERESTARTSYS (To be restarted)
--- SIGTERM (Terminated) @ 0 (0) ---
root at Charter-WB:/# sigreturn()                             = ? (mask now [HUP
INT QUIT TRAP PIPE])
kill(426, SIG_0)                        = 0
wait4(-1, ps -el |grep 426
0 S     0   426     1  0  80   0 -   515 runque ?        00:00:00 rcS
0 S     0   675   426  0  80   0 -   514 runque ?        00:00:00 S95init_user
root at Charter-WB:/# busybox reboot -f
Restarting system.
Kernel panic - not syncing: Software Reset
Rebooting in 2 seconds..

And I did the following patch to work reboot command.

--- ./init/init.c.orig  2019-07-25 17:30:58.000000000 +0530
+++ ./init/init.c       2019-07-25 17:35:48.000000000 +0530
@@ -1009,7 +1009,6 @@
 #endif
                    + (1 << SIGUSR1)
                    + (1 << SIGUSR2)
-                   + (1 << SIGTERM)
                )) {
                        halt_reboot_pwoff(sig);
                }
@@ -1163,6 +1162,10 @@
        /* Set up signal handlers */
        if (!DEBUG_INIT) {
                struct sigaction sa;
+               
+               bb_signals(0
+               + (1 << SIGTERM) /* reboot */
+               , halt_reboot_pwoff);

                /* Stop handler must allow only SIGCONT inside itself */
                memset(&sa, 0, sizeof(sa));
@@ -1188,7 +1191,6 @@
                        + (1 << SIGPWR)  /* halt */
 #endif
                        + (1 << SIGUSR1) /* halt */
-                       + (1 << SIGTERM) /* reboot */
                        + (1 << SIGUSR2) /* poweroff */
 #if ENABLE_FEATURE_USE_INITTAB
                        + (1 << SIGHUP)  /* reread /etc/inittab */

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the busybox-cvs mailing list