From b7bf464a53a3736a410a1d6a191e8980137e0657 Mon Sep 17 00:00:00 2001 From: netblue30 Date: Sun, 27 Mar 2016 19:01:21 -0400 Subject: send stderr to logfile using --output --- src/firejail/output.c | 4 ++-- src/firejail/usage.c | 4 ++-- src/man/firejail.txt | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/firejail/output.c b/src/firejail/output.c index a554b76aa..269ac25ea 100644 --- a/src/firejail/output.c +++ b/src/firejail/output.c @@ -76,7 +76,7 @@ void check_output(int argc, char **argv) { for (i = 0; i < argc; i++) { len += strlen(argv[i]) + 1; // + ' ' } - len += 50 + strlen(outfile); // tee command + len += 100 + strlen(LIBDIR) + strlen(outfile); // tee command char *cmd = malloc(len + 1); // + '\0' if (!cmd) @@ -88,7 +88,7 @@ void check_output(int argc, char **argv) { continue; ptr += sprintf(ptr, "%s ", argv[i]); } - sprintf(ptr, "| %s/firejail/ftee %s", LIBDIR, outfile); + sprintf(ptr, "2>&1 | %s/firejail/ftee %s", LIBDIR, outfile); // run command char *a[4]; diff --git a/src/firejail/usage.c b/src/firejail/usage.c index da5fd4e2f..597005128 100644 --- a/src/firejail/usage.c +++ b/src/firejail/usage.c @@ -157,8 +157,8 @@ void usage(void) { #endif printf(" --nosound - disable sound system.\n\n"); - printf(" --output=logfile - stdout logging and log rotation. Copy stdout to\n"); - printf("\tlogfile, and keep the size of the file under 500KB using log\n"); + printf(" --output=logfile - stdout logging and log rotation. Copy stdout and stderr\n"); + printf("\tto logfile, and keep the size of the file under 500KB using log\n"); printf("\trotation. Five files with prefixes .1 to .5 are used in\n"); printf("\trotation.\n\n"); diff --git a/src/man/firejail.txt b/src/man/firejail.txt index 806a68c3c..6eb7c3ff7 100644 --- a/src/man/firejail.txt +++ b/src/man/firejail.txt @@ -892,7 +892,7 @@ $ firejail \-\-nosound firefox .TP \fB\-\-output=logfile -stdout logging and log rotation. Copy stdout to logfile, and keep the size of the file under 500KB using log +stdout logging and log rotation. Copy stdout and stderr to logfile, and keep the size of the file under 500KB using log rotation. Five files with prefixes .1 to .5 are used in rotation. .br -- cgit v1.2.3-70-g09d2