[BusyBox] bug#1254: marked as done ([patch] init.c restart patch)

BusyBox.net bug Tracking System owner at busybox.net
Tue Jul 2 23:21:03 UTC 2002


Your message dated Tue, 2 Jul 2002 23:15:54 -0600
with message-id <20020703051554.GC18259 at codepoet.org>
and subject line [BusyBox] bug#1254: [patch] init.c restart patch
has caused the attached bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Erik Andersen
(administrator, BusyBox.net bugs database)

--------------------------------------
Received: (at submit) by bugs.busybox.net; 22 Jun 2002 09:43:54 +0000
>From buti at gmx.at  Sat Jun 22 03:43:53 2002
Received: from amilo (unet4-57.univie.ac.at [131.130.233.57])
	by winder.codepoet.org (Postfix) with ESMTP id 45621157991
	for <submit at bugs.busybox.net>; Sat, 22 Jun 2002 03:43:51 -0600 (MDT)
Received: from amilo ([127.0.0.1] ident=till)
	by amilo with esmtp (Exim 3.35 #1 (Debian))
	id 17LhQm-000097-00
	for <submit at bugs.busybox.net>; Sat, 22 Jun 2002 11:43:44 +0200
From: till busch <buti at gmx.at>
Subject: [patch] init.c restart patch
Date: Sat, 22 Jun 2002 11:43:43 +0200
User-Agent: KMail/1.4.1
MIME-Version: 1.0
To: submit at bugs.busybox.net
Content-Type: Multipart/Mixed;
  boundary="------------Boundary-00=_VOP3Y21UGVD50UIRNH03"
Message-Id: <200206221143.43965.buti at gmx.at>


--------------Boundary-00=_VOP3Y21UGVD50UIRNH03
Content-Type: text/plain;
  charset="us-ascii"
Content-Transfer-Encoding: 8bit

Package: busybox
Version: 0.60.3
Severity: bug

hi,

i'm trying to make a bootable cd using busybox. after pivot_root i want 
busybox to exec the real sysvinit (init 2.84, which comes with debian woody). 
everything works nice, except: init (the real one) doesn't get SIGCHLD when 
it's sysinit command exits. i noticed that this is because all signals get 
blocked in shutdown_system(). here is a patch that unblocks them in 
exec_signal(). i hope this is ok.at least it works well for my purposes.

greetings,
- till

--------------Boundary-00=_VOP3Y21UGVD50UIRNH03
Content-Type: text/x-diff;
  charset="us-ascii";
  name="busybox-init.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="busybox-init.diff"

--- busybox-0.60.3/init.c	Sat Apr 27 06:12:55 2002
+++ busybox-0.60.3-till/init.c	Sat Jun 22 11:09:33 2002
@@ -760,10 +760,26 @@
 static void exec_signal(int sig)
 {
 	struct init_action *a, *tmp;
+	sigset_t unblock_signals;
+	
 	for (a = init_action_list; a; a = tmp) {
 		tmp = a->next;
 		if (a->action & RESTART) {
 			shutdown_system();
+
+			/* unblock all signals, blocked in shutdown_system() */
+			sigemptyset(&unblock_signals);
+			sigaddset(&unblock_signals, SIGHUP);
+			sigaddset(&unblock_signals, SIGCHLD);
+			sigaddset(&unblock_signals, SIGUSR1);
+			sigaddset(&unblock_signals, SIGUSR2);
+			sigaddset(&unblock_signals, SIGINT);
+			sigaddset(&unblock_signals, SIGTERM);
+			sigaddset(&unblock_signals, SIGCONT);
+			sigaddset(&unblock_signals, SIGSTOP);
+			sigaddset(&unblock_signals, SIGTSTP);
+			sigprocmask(SIG_UNBLOCK, &unblock_signals, NULL);
+	
 			message(CONSOLE|LOG, "\rTrying to re-exec %s\n", a->command);
 			execl(a->command, a->command, NULL);
 	

--------------Boundary-00=_VOP3Y21UGVD50UIRNH03--

---------------------------------------
Received: (at 1254-done) by bugs.busybox.net; 3 Jul 2002 05:15:55 +0000
>From andersen at codepoet.org  Tue Jul  2 23:15:55 2002
Received: by winder.codepoet.org (Postfix, from userid 1000)
	id A92081579A1; Tue,  2 Jul 2002 23:15:54 -0600 (MDT)
Date: Tue, 2 Jul 2002 23:15:54 -0600
From: Erik Andersen <andersen at codepoet.org>
To: till busch <buti at gmx.at>, 1254-done at bugs.busybox.net
Subject: Re: [BusyBox] bug#1254: [patch] init.c restart patch
Message-ID: <20020703051554.GC18259 at codepoet.org>
Reply-To: andersen at codepoet.org
References: <200206221143.43965.buti at gmx.at>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <200206221143.43965.buti at gmx.at>
User-Agent: Mutt/1.3.28i
X-Operating-System: Linux 2.4.18-rmk7, Rebel-NetWinder(Intel StrongARM 110 rev 3), 185.95 BogoMips
X-No-Junk-Mail: I do not want to get *any* junk mail.

On Sat Jun 22, 2002 at 11:43:43AM +0200, till busch wrote:
> Package: busybox
> Version: 0.60.3
> Severity: bug
> 
> hi,
> 
> i'm trying to make a bootable cd using busybox. after pivot_root i want 
> busybox to exec the real sysvinit (init 2.84, which comes with debian woody). 
> everything works nice, except: init (the real one) doesn't get SIGCHLD when 
> it's sysinit command exits. i noticed that this is because all signals get 
> blocked in shutdown_system(). here is a patch that unblocks them in 
> exec_signal(). i hope this is ok.at least it works well for my purposes.

Looks fine to me.  Applied, thanks!

 -Erik

--
Erik B. Andersen             http://codepoet-consulting.com/
--This message was written using 73% post-consumer electrons--



More information about the busybox mailing list