From 2f527215d0657e895b57080184def72d413672b7 Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Mon, 17 Sep 2012 11:08:10 +0200 Subject: [PATCH] Compat kernel command line debug option --verbose Check for "--verbose", as well as "finit_debug", on kernel command line to enable debugging of finit. The former is a compatibility option with upstart, see http://upstart.ubuntu.com/wiki/Debugging Add the following to the kernel command line to enable: "init=/sbin/finit --verbose" Without the quote characters. Signed-off-by: Joachim Nilsson --- finit.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/finit.c b/finit.c index 1322ea43..a6d28ca2 100644 --- a/finit.c +++ b/finit.c @@ -87,14 +87,18 @@ int main(void) */ if ((f = fopen("/proc/cmdline", "r")) != NULL) { fgets(line, LINE_SIZE, f); - if ((strstr(line, "finit_debug"))) { + + if (strstr(line, "finit_debug") || + strstr(line, "--verbose")) { debug = 1; } + if (strstr(line, "quiet")) { close(0); close(1); close(2); } + fclose(f); }