diff options
-rw-r--r-- | conf.c | 3 | ||||
-rw-r--r-- | passt.c | 2 |
2 files changed, 4 insertions, 1 deletions
@@ -1631,6 +1631,9 @@ void conf(struct ctx *c, int argc, char **argv) conf_ugid(runas, &uid, &gid); + if (!c->foreground && c->force_stderr) + die("Can't log to standard error if not running in foreground"); + if (logfile) { logfile_init(c->mode == MODE_PASTA ? "pasta" : "passt", logfile, logsize); @@ -302,7 +302,7 @@ int main(int argc, char **argv) if (isolate_prefork(&c)) die("Failed to sandbox process, exiting"); - if (!c.force_stderr && !isatty(fileno(stderr))) + if (!c.foreground || (!c.force_stderr && !isatty(fileno(stderr)))) __openlog(log_name, 0, LOG_DAEMON); if (!c.foreground) |