[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1039710: debian-installer: Grub installation fails and /var/log/syslog is empty



On Wed, Jul 12, 2023 at 11:15:57AM +0200, Cyril Brulebois wrote:
>Hi Michael,
>
>Cyril Brulebois <kibi@debian.org> (2023-06-28):
>> Control: reassign -1 busybox-udeb 1:1.36.1-3
>
>[…]
>
>> With a local build, confirmed -3 is buggy, and that reverting only
>> busybox-udeb to -1 is sufficient to restore syslog support in the
>> installer.
>> 
>> Reassigning there; the GRUB thing can be filed separately once we have
>> actual information via syslog.
>
>A fix would be appreciated, we've got reports piling up about things we
>have no logs for.

After weeks with this breakage, I've just uploaded a minimal NMU to
fix it, reverting the syslog changes since -1. I've buit and tested
successfully locally.

Here's the NMU diff.

-- 
Steve McIntyre, Cambridge, UK.                                steve@einval.com
You raise the blade, you make the change... You re-arrange me 'til I'm sane...
diff -Nru busybox-1.36.1/debian/changelog busybox-1.36.1/debian/changelog
--- busybox-1.36.1/debian/changelog	2023-06-14 22:01:54.000000000 +0100
+++ busybox-1.36.1/debian/changelog	2023-08-03 21:22:44.000000000 +0100
@@ -1,3 +1,11 @@
+busybox (1:1.36.1-3.1) unstable; urgency=medium
+
+  * NMU
+  * Revert recent changes that have broken syslogd in d-i.
+    Closes: #1039710
+
+ -- Steve McIntyre <93sam@debian.org>  Thu, 03 Aug 2023 21:22:44 +0100
+
 busybox (1:1.36.1-3) unstable; urgency=medium
 
   * syslogd-avoid-nulling-devlog.patch - fix overriding dev/log
diff -Nru busybox-1.36.1/debian/patches/series busybox-1.36.1/debian/patches/series
--- busybox-1.36.1/debian/patches/series	2023-06-14 21:55:08.000000000 +0100
+++ busybox-1.36.1/debian/patches/series	2023-08-03 21:22:44.000000000 +0100
@@ -14,6 +14,7 @@
 platform-linux.diff
 fix-non-linux-build.patch
 #
-syslogd-decrease-stack-usage-50-bytes.patch
-syslogd-daemonize-after-init-make-errs-visible.patch
-syslogd-avoid-nulling-devlog.patch
+syslogd-fork-after-init-not-before.patch
+#syslogd-decrease-stack-usage-50-bytes.patch
+#syslogd-daemonize-after-init-make-errs-visible.patch
+#syslogd-avoid-nulling-devlog.patch
diff -Nru busybox-1.36.1/debian/patches/syslogd-fork-after-init-not-before.patch busybox-1.36.1/debian/patches/syslogd-fork-after-init-not-before.patch
--- busybox-1.36.1/debian/patches/syslogd-fork-after-init-not-before.patch	1970-01-01 01:00:00.000000000 +0100
+++ busybox-1.36.1/debian/patches/syslogd-fork-after-init-not-before.patch	2023-08-03 21:22:44.000000000 +0100
@@ -0,0 +1,58 @@
+From: Michael Tokarev <mjt@tls.msk.ru>
+Date: Tue, 6 Jun 2023 17:08:18 +0300
+Subject: [PATCH] syslogd: fork after init on a regular system, not before
+
+Current syslogd performs all init after daemonizing, meanwhile
+main process exits successfully. This means any errors during init
+will not be even shown up because at this time the process has its
+stderr redirected to /dev/null already.
+
+On a MMU system, delay daemonizing to after init.
+On non-MMU system, keep current code.
+
+Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
+---
+ sysklogd/syslogd.c | 13 ++++++++++++-
+ 1 file changed, 12 insertions(+), 1 deletion(-)
+
+diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c
+index 6ddfd771a..2f9a727cd 100644
+--- a/sysklogd/syslogd.c
++++ b/sysklogd/syslogd.c
+@@ -1025,7 +1025,6 @@ static void do_syslogd(void)
+ 	signal(SIGALRM, do_mark);
+ 	alarm(G.markInterval);
+ #endif
+-	xmove_fd(create_socket(), STDIN_FILENO);
+ 
+ 	if (option_mask32 & OPT_circularlog)
+ 		ipcsyslog_init();
+@@ -1033,6 +1032,16 @@ static void do_syslogd(void)
+ 	if (option_mask32 & OPT_kmsg)
+ 		kmsg_init();
+ 
++	{
++		int fd = create_socket();
++#if BB_MMU
++		if (!(option_mask32 & OPT_nofork)) {
++			bb_daemonize(DAEMON_CHDIR_ROOT);
++		}
++#endif
++		xmove_fd(fd, STDIN_FILENO);
++	}
++
+ 	timestamp_and_log_internal("syslogd started: BusyBox v" BB_VER);
+ 	write_pidfile_std_path_and_ext("syslogd");
+ 
+@@ -1179,9 +1188,11 @@ int syslogd_main(int argc UNUSED_PARAM, char **argv)
+ 	G.hostname = safe_gethostname();
+ 	*strchrnul(G.hostname, '.') = '\0';
+ 
++#if !BB_MMU
+ 	if (!(opts & OPT_nofork)) {
+ 		bb_daemonize_or_rexec(DAEMON_CHDIR_ROOT, argv);
+ 	}
++#endif
+ 
+ 	do_syslogd();
+ 	/* return EXIT_SUCCESS; */

Reply to: