From 6a2950aef097c22d01c565c1b6e41bb69360feda Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Thu, 12 Jun 2014 00:19:01 +0900 Subject: [PATCH] nghttpx: Make tty to false when daemonized --- src/shrpx.cc | 4 ++++ src/shrpx_config.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/shrpx.cc b/src/shrpx.cc index ededee25..7207f343 100644 --- a/src/shrpx.cc +++ b/src/shrpx.cc @@ -280,6 +280,10 @@ int event_loop() LOG(FATAL) << "Failed to daemonize: " << strerror(errno); exit(EXIT_FAILURE); } + + // Set tty = false when daemonized. syslog is garbling with ANSI + // escape. + mod_config()->tty = false; } if(get_config()->pid_file) { diff --git a/src/shrpx_config.h b/src/shrpx_config.h index 1d04c001..9d6b57da 100644 --- a/src/shrpx_config.h +++ b/src/shrpx_config.h @@ -251,7 +251,7 @@ struct Config { bool insecure; bool backend_ipv4; bool backend_ipv6; - // true if stderr refers to a terminal. + // true if stderr refers to a terminal and not daemonized bool tty; bool http2_no_cookie_crumbling; bool upstream_frame_debug;