Log startup/shutdown to console
authorJohn Crispin <blogic@openwrt.org>
Thu, 30 Oct 2014 10:07:26 +0000 (11:07 +0100)
committerJohn Crispin <blogic@openwrt.org>
Thu, 30 Oct 2014 10:07:26 +0000 (11:07 +0100)
procd has the habit of logging startup/shutdown via
rcS to syslog, which is pointless in case of a
shutdown, and unlikely to be complete on a startup
(as syslog is not running). Write to the console
instead.

Signed-off-by: Michel Stam <m.stam@fugro.nl>
Signed-off-by: John Crispin <blogic@openwrt.org>
rcS.c

diff --git a/rcS.c b/rcS.c
index 45456215af023d67edb10ed715ec296f3f9a250b..8c72c194614809d98b09fe9ad6ccf30f64ebe64b 100644 (file)
--- a/rcS.c
+++ b/rcS.c
@@ -55,6 +55,9 @@ static void pipe_cb(struct ustream *s, int bytes)
                *newline = 0;
                len = newline + 1 - str;
                syslog(0, "%s", str);
+#ifdef SHOW_BOOT_ON_CONSOLE
+               fprintf(stderr, "%s\n", str);
+#endif
                ustream_consume(s, len);
        } while (1);
 }