[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    [BusyBox] bug#1254: [patch] init.c restart patch
From:       till busch <buti () gmx ! at>
Date:       2002-06-22 3:46:03
[Download RAW message or body]

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

["busybox-init.diff" (text/x-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);
 	


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic