summaryrefslogtreecommitdiff
path: root/sapi
diff options
context:
space:
mode:
authorRemi Collet <remi@php.net>2014-06-27 09:45:53 +0200
committerRemi Collet <remi@php.net>2014-06-27 09:45:53 +0200
commita0ecb3794f00e65cd2a073b2073e32d6c2fb7180 (patch)
tree23da7ce25bafb0a83334f4d56774f92285bffb87 /sapi
parent2db96fea2d87bf3e24760e846b4a8633bd158330 (diff)
downloadphp-git-a0ecb3794f00e65cd2a073b2073e32d6c2fb7180.tar.gz
Fix Bug #67530 error_log=syslog ignored
As for Bug #64915 Systemd use --nodaemonize but need to error_log to file or syslog to be honoured
Diffstat (limited to 'sapi')
-rw-r--r--sapi/fpm/fpm/fpm_stdio.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sapi/fpm/fpm/fpm_stdio.c b/sapi/fpm/fpm/fpm_stdio.c
index d81e10150d..769d3a6338 100644
--- a/sapi/fpm/fpm/fpm_stdio.c
+++ b/sapi/fpm/fpm/fpm_stdio.c
@@ -268,7 +268,11 @@ int fpm_stdio_open_error_log(int reopen) /* {{{ */
if (!strcasecmp(fpm_global_config.error_log, "syslog")) {
openlog(fpm_global_config.syslog_ident, LOG_PID | LOG_CONS, fpm_global_config.syslog_facility);
fpm_globals.error_log_fd = ZLOG_SYSLOG;
+#if HAVE_UNISTD_H
+ if (fpm_global_config.daemonize || (!isatty(STDERR_FILENO) && !fpm_globals.force_stderr)) {
+#else
if (fpm_global_config.daemonize) {
+#endif
zlog_set_fd(fpm_globals.error_log_fd);
}
return 0;