summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Crispin <blogic@openwrt.org>2014-10-30 11:07:26 +0100
committerJohn Crispin <blogic@openwrt.org>2014-10-30 11:07:26 +0100
commit07c7864d49723b1264ee8bcd6861ea92f679ee98 (patch)
tree5bb09ed37f0291db0e4dfabad022ce90b8be6515
parentb9a389c841db8433bb3b02158b1512cf577dbff7 (diff)
downloadunitd-07c7864d49723b1264ee8bcd6861ea92f679ee98.tar
unitd-07c7864d49723b1264ee8bcd6861ea92f679ee98.zip
Log startup/shutdown to console
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>
-rw-r--r--rcS.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/rcS.c b/rcS.c
index 4545621..8c72c19 100644
--- 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);
}