Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master grimoire by Vlad Glagolev (766eb83e02cbc3c1d5a57e362d1248d1ec2c3a1b)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Vlad Glagolev <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master grimoire by Vlad Glagolev (766eb83e02cbc3c1d5a57e362d1248d1ec2c3a1b)
  • Date: Fri, 7 Aug 2009 06:01:45 -0500

GIT changes to master grimoire by Vlad Glagolev <stealth AT sourcemage.org>:

http/nginx/DETAILS | 7 -
http/nginx/HISTORY | 6
http/nginx/PREPARE | 3
http/nginx/PRE_BUILD | 6
http/nginx/syslog-0.6.patch | 277
++++++++++++++++++++++++++++++++++++++++++++
http/nginx/syslog-0.7.patch | 239 +++++++++++++++++++++++++++++++++++++
http/nginx/syslog.patch | 277
--------------------------------------------
7 files changed, 535 insertions(+), 280 deletions(-)

New commits:
commit 766eb83e02cbc3c1d5a57e362d1248d1ec2c3a1b
Author: Vlad Glagolev <stealth AT sourcemage.org>
Commit: Vlad Glagolev <stealth AT sourcemage.org>

nginx: added 0.7 branch as stable, 0.6 goes for legacy

diff --git a/http/nginx/DETAILS b/http/nginx/DETAILS
index 98b17fc..e43bb23 100755
--- a/http/nginx/DETAILS
+++ b/http/nginx/DETAILS
@@ -1,8 +1,13 @@
SPELL=nginx
+if [[ $NGINX_RELEASE == legacy ]]; then
VERSION=0.6.38
+
SOURCE_HASH=sha512:99263b27a1c9af07afcc009b61e9df60a81ebb2a82a894ddcf7b83f6d3123404463eea1e5640129057d5f7e24ad8b84a04a1d1e3cd1d3c92d1b3395083cdd6a4
+else
+ VERSION=0.7.61
+
SOURCE_HASH=sha512:6db888a296100f26311bca098d6b02c7f15dfeee30c666bb4d73822f3dc1e6c76d53e521be7107f820551cb14a39a18fd3c7b8f702f8c2cc029d57ddd5023d7f
+fi
SOURCE=$SPELL-$VERSION.tar.gz
SOURCE_URL[0]=http://sysoev.ru/$SPELL/$SOURCE
-
SOURCE_HASH=sha512:99263b27a1c9af07afcc009b61e9df60a81ebb2a82a894ddcf7b83f6d3123404463eea1e5640129057d5f7e24ad8b84a04a1d1e3cd1d3c92d1b3395083cdd6a4
SOURCE_DIRECTORY="$BUILD_DIRECTORY/$SPELL-$VERSION"
WEB_SITE=http://nginx.net/
LICENSE[0]=BSD
diff --git a/http/nginx/HISTORY b/http/nginx/HISTORY
index 8e1046c..c21d2cf 100644
--- a/http/nginx/HISTORY
+++ b/http/nginx/HISTORY
@@ -1,6 +1,10 @@
2009-08-07 Vlad Glagolev <stealth AT sourcemage.org>
- * DETAILS: updated spell to 0.6.38
+ * DETAILS: updated spell to 0.6.38 (marked as legacy); added stable
version
* BUILD, INSTALL: fixed multijob build
+ * PREPARE: added stable version
+ * PRE_BUILD: adopted patch-applying for multi-version
+ * syslog.patch: -> syslog-0.6.patch
+ * syslog-0.7.patch: added

2009-05-23 Vlad Glagolev <stealth AT sourcemage.org>
* DETAILS: updated spell to 0.6.37
diff --git a/http/nginx/PREPARE b/http/nginx/PREPARE
new file mode 100755
index 0000000..e261436
--- /dev/null
+++ b/http/nginx/PREPARE
@@ -0,0 +1,3 @@
+config_query_list NGINX_RELEASE "Select which release to build:" \
+ stable \
+ legacy
diff --git a/http/nginx/PRE_BUILD b/http/nginx/PRE_BUILD
index 6b9619e..1760c95 100755
--- a/http/nginx/PRE_BUILD
+++ b/http/nginx/PRE_BUILD
@@ -2,5 +2,9 @@ default_pre_build &&
cd "$SOURCE_DIRECTORY" &&

if list_find "$NGINX_OPTS" "--with-syslog"; then
- patch -p0 < "$SPELL_DIRECTORY/syslog.patch"
+ if [[ $NGINX_RELEASE == legacy ]]; then
+ patch -p0 < "$SPELL_DIRECTORY/syslog-0.6.patch"
+ else
+ patch -p0 < "$SPELL_DIRECTORY/syslog-0.7.patch"
+ fi
fi
diff --git a/http/nginx/syslog-0.6.patch b/http/nginx/syslog-0.6.patch
new file mode 100644
index 0000000..5f636b8
--- /dev/null
+++ b/http/nginx/syslog-0.6.patch
@@ -0,0 +1,277 @@
+--- auto/make.orig 2008-03-18 11:36:27.000000000 +0100
++++ auto/make 2008-05-16 11:12:43.000000000 +0200
+@@ -13,6 +13,10 @@
+ ngx_objs_dir=$NGX_OBJS$ngx_regex_dirsep
+ ngx_use_pch=`echo $NGX_USE_PCH | sed -e "s/\//$ngx_regex_dirsep/g"`
+
++#SYSLOG
++if [[ "${USE_SYSLOG}" == "YES" ]]; then
++ CFLAGS="$CFLAGS -DUSE_SYSLOG"
++fi
+
+ cat << END >
$NGX_MAKEFILE
+
+--- auto/options.orig 2008-04-29 11:27:55.000000000 +0200
++++ auto/options 2008-05-16 11:12:43.000000000 +0200
+@@ -102,6 +102,8 @@
+ MD5_OPT=
+ MD5_ASM=NO
+
++USE_SYSLOG=NO
++
+ USE_SHA1=NO
+ SHA1=NONE
+ SHA1_OPT=
+@@ -225,6 +227,8 @@
+ --with-md5-opt=*) MD5_OPT="$value" ;;
+ --with-md5-asm) MD5_ASM=YES ;;
+
++ --with-syslog) USE_SYSLOG=YES ;;
++
+ --with-sha1=*) SHA1="$value" ;;
+ --with-sha1-opt=*) SHA1_OPT="$value" ;;
+ --with-sha1-asm) SHA1_ASM=YES ;;
+@@ -233,6 +237,8 @@
+ --with-zlib-opt=*) ZLIB_OPT="$value" ;;
+ --with-zlib-asm=*) ZLIB_ASM="$value" ;;
+
++ --with-syslog) USE_SYSLOG="YES" ;;
++
+ --test-build-devpoll) NGX_TEST_BUILD_DEVPOLL=YES ;;
+ --test-build-eventport) NGX_TEST_BUILD_EVENTPORT=YES ;;
+ --test-build-epoll) NGX_TEST_BUILD_EPOLL=YES ;;
+@@ -341,6 +347,8 @@
+ --with-md5-opt=OPTIONS set additional options for md5 building
+ --with-md5-asm use md5 assembler sources
+
++ --with-syslog use syslog instead of files to
log messages
++
+ --with-sha1=DIR set path to sha1 library sources
+ --with-sha1-opt=OPTIONS set additional options for sha1
building
+ --with-sha1-asm use sha1 assembler sources
+@@ -356,6 +364,8 @@
+
+ --with-debug enable the debugging logging
+
++ --with-syslog enable syslog support (disables
writing to file)
++
+ END
+
+ exit 1
+--- auto/summary.orig 2008-04-29 11:27:55.000000000 +0200
++++ auto/summary 2008-05-16 11:12:43.000000000 +0200
+@@ -83,6 +83,11 @@
+ *) echo " + using zlib library: $ZLIB" ;;
+ esac
+
++case $USE_SYSLOG in
++ YES) echo " + using syslog" ;;
++ *) echo " + syslog is not used" ;;
++esac
++
+ echo
+
+
+--- src/core/nginx.c.orig 2007-12-10 13:09:51.000000000 +0100
++++ src/core/nginx.c 2008-05-16 11:12:43.000000000 +0200
+@@ -9,6 +9,9 @@
+ #include <ngx_event.h>
+ #include <nginx.h>
+
++#ifdef USE_SYSLOG
++#include <syslog.h>
++#endif
+
+ static ngx_int_t ngx_add_inherited_sockets(ngx_cycle_t *cycle);
+ static ngx_int_t ngx_getopt(ngx_cycle_t *cycle, int argc, char *const
*argv);
+@@ -221,6 +224,11 @@
+ ngx_ssl_init(log);
+ #endif
+
++ /* SYSLOG SUPPORT */
++#ifdef USE_SYSLOG
++ openlog("nginx", LOG_ODELAY, LOG_DAEMON);
++#endif
++
+ /* init_cycle->log is required for signal handlers and ngx_getopt() */
+
+ ngx_memzero(&init_cycle, sizeof(ngx_cycle_t));
+@@ -358,6 +366,10 @@
+ ngx_single_process_cycle(cycle);
+ }
+
++#ifdef USE_SYSLOG
++ closelog();
++#endif
++
+ return 0;
+ }
+
+--- src/core/ngx_conf_file.c.orig 2008-04-29 11:28:42.000000000 +0200
++++ src/core/ngx_conf_file.c 2008-05-16 11:12:43.000000000 +0200
+@@ -751,6 +751,11 @@
+ full.data = NULL;
+ #endif
+
++#ifdef USE_SYSLOG
++if (name) {
++ name = NULL;
++}
++#endif
+ if (name) {
+ full = *name;
+
+--- src/core/ngx_log.c.orig 2009-04-01 20:19:22.000000000 +0400
++++ src/core/ngx_log.c 2009-04-25 19:45:12.992533679 +0400
+@@ -7,6 +7,9 @@
+ #include <ngx_config.h>
+ #include <ngx_core.h>
+
++#ifdef USE_SYSLOG
++#include <syslog.h>
++#endif
+
+ static char *ngx_set_error_log(ngx_conf_t *cf, ngx_command_t *cmd, void
*conf);
+
+@@ -81,17 +84,22 @@
+ #endif
+ u_char errstr[NGX_MAX_ERROR_STR], *p, *last;
+
++#ifndef USE_SYSLOG
+ if (log->file->fd == NGX_INVALID_FILE) {
+ return;
+ }
++#endif
+
+ last = errstr + NGX_MAX_ERROR_STR;
+
++#ifdef USE_SYSLOG
++ p = errstr;
++#else
+ ngx_memcpy(errstr, ngx_cached_err_log_time.data,
+ ngx_cached_err_log_time.len);
+
+ p = errstr + ngx_cached_err_log_time.len;
+-
++#endif
+ p = ngx_snprintf(p, last - p, " [%s] ", err_levels[level]);
+
+ /* pid#tid */
+@@ -150,7 +158,22 @@
+
+ ngx_linefeed(p);
+
++#ifdef USE_SYSLOG
++ /* allocate a string which can hold the error message */
++ char *syslogstr;
++
++ if ((syslogstr = calloc((p - errstr + 1), sizeof(char))) != NULL)
++ {
++ strncpy(syslogstr, errstr, p - errstr);
++
++ /* write to syslog */
++ syslog(LOG_CRIT, "%s", syslogstr);
++
++ free(syslogstr);
++ }
++#else
+ (void) ngx_write_fd(log->file->fd, errstr, p - errstr);
++#endif
+ }
+
+
+@@ -234,6 +257,9 @@
+ ngx_log_t *log;
+ ngx_str_t *value, *name;
+
++#ifdef USE_SYSLOG
++ name = value = NULL;
++#else
+ if (args) {
+ value = args->elts;
+ name = &value[1];
+@@ -241,6 +267,7 @@
+ } else {
+ name = NULL;
+ }
++#endif
+
+ log = ngx_pcalloc(cycle->pool, sizeof(ngx_log_t));
+ if (log == NULL) {
+--- src/http/modules/ngx_http_log_module.c.orig 2007-11-15
15:26:36.000000000 +0100
++++ src/http/modules/ngx_http_log_module.c 2008-05-16 11:56:39.000000000
+0200
+@@ -9,6 +9,9 @@
+ #include <ngx_http.h>
+ #include <nginx.h>
+
++#ifdef USE_SYSLOG
++#include <syslog.h>
++#endif
+
+ typedef struct ngx_http_log_op_s ngx_http_log_op_t;
+
+@@ -160,7 +163,11 @@
+
+
+ static ngx_str_t ngx_http_combined_fmt =
++#ifdef USE_SYSLOG
++ ngx_string("$remote_addr - $remote_user "
++#else
+ ngx_string("$remote_addr - $remote_user [$time_local] "
++#endif
+ "\"$request\" $status $body_bytes_sent "
+ "\"$http_referer\" \"$http_user_agent\"");
+
+@@ -285,6 +292,20 @@
+ ngx_http_log_write(ngx_http_request_t *r, ngx_http_log_t *log, u_char *buf,
+ size_t len)
+ {
++#ifdef USE_SYSLOG
++ /* allocate a string which can hold the error message */
++ char *syslogstr;
++
++ if ((syslogstr = calloc((len + 1), sizeof(char))) != NULL)
++ {
++ strncpy(syslogstr, buf, len);
++
++ /* write to syslog */
++ syslog(LOG_NOTICE, "%s", syslogstr);
++
++ free(syslogstr);
++ }
++#else
+ time_t now;
+ ssize_t n;
+ ngx_err_t err;
+@@ -322,6 +343,7 @@
+
+ log->error_log_time = now;
+ }
++#endif
+ }
+
+
+@@ -654,7 +676,11 @@
+ return NGX_CONF_ERROR;
+ }
+
++#ifdef USE_SYLOG
++ log->file = ngx_conf_open_file(cf->cycle, NULL);
++#else
+ log->file = ngx_conf_open_file(cf->cycle, &ngx_http_access_log);
++#endif
+ if (log->file == NULL) {
+ return NGX_CONF_ERROR;
+ }
+@@ -706,7 +732,11 @@
+ return NGX_CONF_ERROR;
+ }
+
++#ifdef USE_SYSLOG
++ log->file = ngx_conf_open_file(cf->cycle, NULL);
++#else
+ log->file = ngx_conf_open_file(cf->cycle, &value[1]);
++#endif
+ if (log->file == NULL) {
+ return NGX_CONF_ERROR;
+ }
diff --git a/http/nginx/syslog-0.7.patch b/http/nginx/syslog-0.7.patch
new file mode 100644
index 0000000..c2a77e9
--- /dev/null
+++ b/http/nginx/syslog-0.7.patch
@@ -0,0 +1,239 @@
+--- auto/make.orig 2009-05-12 20:15:43.000000000 +0700
++++ auto/make 2009-07-08 16:32:06.000000000 +0700
+@@ -15,6 +15,10 @@
+ ngx_objs_dir=$NGX_OBJS$ngx_regex_dirsep
+ ngx_use_pch=`echo $NGX_USE_PCH | sed -e "s/\//$ngx_regex_dirsep/g"`
+
++#SYSLOG
++if [[ "${USE_SYSLOG}" == "YES" ]]; then
++ CFLAGS="$CFLAGS -DUSE_SYSLOG"
++fi
+
+ cat << END >
$NGX_MAKEFILE
+
+--- auto/options.orig 2009-05-18 23:50:32.000000000 +0700
++++ auto/options 2009-07-08 17:57:57.000000000 +0700
+@@ -110,6 +110,8 @@
+ MD5_OPT=
+ MD5_ASM=NO
+
++USE_SYSLOG=NO
++
+ USE_SHA1=NO
+ SHA1=NONE
+ SHA1_OPT=
+@@ -252,6 +254,8 @@
+ --with-md5-opt=*) MD5_OPT="$value" ;;
+ --with-md5-asm) MD5_ASM=YES ;;
+
++ --with-syslog) USE_SYSLOG=YES ;;
++
+ --with-sha1=*) SHA1="$value" ;;
+ --with-sha1-opt=*) SHA1_OPT="$value" ;;
+ --with-sha1-asm) SHA1_ASM=YES ;;
+@@ -381,6 +385,8 @@
+ --with-md5-opt=OPTIONS set additional options for md5 building
+ --with-md5-asm use md5 assembler sources
+
++ --with-syslog use syslog instead of files to
log messages
++
+ --with-sha1=DIR set path to sha1 library sources
+ --with-sha1-opt=OPTIONS set additional options for sha1
building
+ --with-sha1-asm use sha1 assembler sources
+@@ -395,6 +401,7 @@
+ --with-openssl-opt=OPTIONS set additional options for OpenSSL
building
+
+ --with-debug enable the debugging logging
++
+
+ END
+
+--- auto/summary.orig 2009-05-26 21:28:49.000000000 +0700
++++ auto/summary 2009-07-08 16:35:19.000000000 +0700
+@@ -71,6 +71,11 @@
+ *) echo " + using zlib library: $ZLIB" ;;
+ esac
+
++case $USE_SYSLOG in
++ YES) echo " + using syslog" ;;
++ *) echo " + syslog is not used" ;;
++esac
++
+ echo
+
+
+--- src/core/nginx.c.orig 2009-06-06 19:41:31.000000000 +0700
++++ src/core/nginx.c 2009-07-08 16:39:57.000000000 +0700
+@@ -8,6 +8,9 @@
+ #include <ngx_core.h>
+ #include <nginx.h>
+
++#ifdef USE_SYSLOG
++#include <syslog.h>
++#endif
+
+ static ngx_int_t ngx_add_inherited_sockets(ngx_cycle_t *cycle);
+ static ngx_int_t ngx_get_options(int argc, char *const *argv);
+@@ -271,6 +274,11 @@
+ ngx_ssl_init(log);
+ #endif
+
++ /* SYSLOG SUPPORT */
++#ifdef USE_SYSLOG
++ openlog("nginx", LOG_ODELAY, LOG_DAEMON);
++#endif
++
+ /*
+ * init_cycle->log is required for signal handlers and
+ * ngx_process_options()
+@@ -382,6 +390,10 @@
+ ngx_master_process_cycle(cycle);
+ }
+
++#ifdef USE_SYSLOG
++ closelog();
++#endif
++
+ return 0;
+ }
+
+--- src/core/ngx_conf_file.c.orig 2009-06-02 21:00:01.000000000 +0700
++++ src/core/ngx_conf_file.c 2009-07-08 19:25:57.000000000 +0700
+@@ -907,6 +907,12 @@
+ full.data = NULL;
+ #endif
+
++#ifdef USE_SYSLOG
++ if (name->len) {
++ name->len = 0;
++ }
++#endif
++
+ if (name->len) {
+ full = *name;
+
+--- src/core/ngx_log.c.orig 2009-04-30 20:53:42.000000000 +0700
++++ src/core/ngx_log.c 2009-07-08 19:26:02.000000000 +0700
+@@ -7,6 +7,9 @@
+ #include <ngx_config.h>
+ #include <ngx_core.h>
+
++#ifdef USE_SYSLOG
++#include <syslog.h>
++#endif
+
+ static char *ngx_error_log(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
+
+@@ -90,9 +93,11 @@
+ u_char *p, *last, *msg;
+ u_char errstr[NGX_MAX_ERROR_STR];
+
++#ifndef USE_SYSLOG
+ if (log->file->fd == NGX_INVALID_FILE) {
+ return;
+ }
++#endif
+
+ last = errstr + NGX_MAX_ERROR_STR;
+
+@@ -139,7 +144,21 @@
+
+ ngx_linefeed(p);
+
++#ifdef USE_SYSLOG
++ /* allocate a string which can hold the error message */
++ char *syslogstr;
++
++ if ((syslogstr = calloc((p - errstr + 1), sizeof(char))) != NULL) {
++ strncpy(syslogstr, errstr, p - errstr);
++
++ /* write to syslog */
++ syslog(LOG_CRIT, "%s", syslogstr);
++
++ free(syslogstr);
++ }
++#else
+ (void) ngx_write_fd(log->file->fd, errstr, p - errstr);
++#endif
+
+ if (!ngx_use_stderr
+ || level > NGX_LOG_WARN
+@@ -428,9 +447,13 @@
+
+ value = cf->args->elts;
+
++#ifdef USE_SYSLOG
++ value[1].data = "stderr";
++#endif
++
+ if (ngx_strcmp(value[1].data, "stderr") == 0) {
+ name.len = 0;
+- name.data = NULL;
++ name.data = "";
+
+ } else {
+ name = value[1];
+--- src/http/modules/ngx_http_log_module.c.orig 2009-06-02
23:09:44.000000000 +0700
++++ src/http/modules/ngx_http_log_module.c 2009-07-08 19:56:29.000000000
+0700
+@@ -8,6 +8,9 @@
+ #include <ngx_core.h>
+ #include <ngx_http.h>
+
++#ifdef USE_SYSLOG
++#include <syslog.h>
++#endif
+
+ typedef struct ngx_http_log_op_s ngx_http_log_op_t;
+
+@@ -310,6 +313,19 @@
+ ngx_http_log_write(ngx_http_request_t *r, ngx_http_log_t *log, u_char *buf,
+ size_t len)
+ {
++#ifdef USE_SYSLOG
++ /* allocate a string which can hold the error message */
++ char *syslogstr;
++
++ if ((syslogstr = calloc((len + 1), sizeof(char))) != NULL) {
++ strncpy(syslogstr, buf, len);
++
++ /* write to syslog */
++ syslog(LOG_NOTICE, "%s", syslogstr);
++
++ free(syslogstr);
++ }
++#else
+ u_char *name;
+ time_t now;
+ ssize_t n;
+@@ -354,6 +370,7 @@
+
+ log->error_log_time = now;
+ }
++#endif
+ }
+
+
+@@ -800,7 +817,11 @@
+ return NGX_CONF_ERROR;
+ }
+
++#ifdef USE_SYSLOG
++ ngx_http_access_log.data = "";
++#endif
+ log->file = ngx_conf_open_file(cf->cycle, &ngx_http_access_log);
++
+ if (log->file == NULL) {
+ return NGX_CONF_ERROR;
+ }
+@@ -859,7 +880,11 @@
+ n = ngx_http_script_variables_count(&value[1]);
+
+ if (n == 0) {
++#ifdef USE_SYSLOG
++ value[1].data = "";
++#endif
+ log->file = ngx_conf_open_file(cf->cycle, &value[1]);
++
+ if (log->file == NULL) {
+ return NGX_CONF_ERROR;
+ }
diff --git a/http/nginx/syslog.patch b/http/nginx/syslog.patch
deleted file mode 100644
index 5f636b8..0000000
--- a/http/nginx/syslog.patch
+++ /dev/null
@@ -1,277 +0,0 @@
---- auto/make.orig 2008-03-18 11:36:27.000000000 +0100
-+++ auto/make 2008-05-16 11:12:43.000000000 +0200
-@@ -13,6 +13,10 @@
- ngx_objs_dir=$NGX_OBJS$ngx_regex_dirsep
- ngx_use_pch=`echo $NGX_USE_PCH | sed -e "s/\//$ngx_regex_dirsep/g"`
-
-+#SYSLOG
-+if [[ "${USE_SYSLOG}" == "YES" ]]; then
-+ CFLAGS="$CFLAGS -DUSE_SYSLOG"
-+fi
-
- cat << END >
$NGX_MAKEFILE
-
---- auto/options.orig 2008-04-29 11:27:55.000000000 +0200
-+++ auto/options 2008-05-16 11:12:43.000000000 +0200
-@@ -102,6 +102,8 @@
- MD5_OPT=
- MD5_ASM=NO
-
-+USE_SYSLOG=NO
-+
- USE_SHA1=NO
- SHA1=NONE
- SHA1_OPT=
-@@ -225,6 +227,8 @@
- --with-md5-opt=*) MD5_OPT="$value" ;;
- --with-md5-asm) MD5_ASM=YES ;;
-
-+ --with-syslog) USE_SYSLOG=YES ;;
-+
- --with-sha1=*) SHA1="$value" ;;
- --with-sha1-opt=*) SHA1_OPT="$value" ;;
- --with-sha1-asm) SHA1_ASM=YES ;;
-@@ -233,6 +237,8 @@
- --with-zlib-opt=*) ZLIB_OPT="$value" ;;
- --with-zlib-asm=*) ZLIB_ASM="$value" ;;
-
-+ --with-syslog) USE_SYSLOG="YES" ;;
-+
- --test-build-devpoll) NGX_TEST_BUILD_DEVPOLL=YES ;;
- --test-build-eventport) NGX_TEST_BUILD_EVENTPORT=YES ;;
- --test-build-epoll) NGX_TEST_BUILD_EPOLL=YES ;;
-@@ -341,6 +347,8 @@
- --with-md5-opt=OPTIONS set additional options for md5 building
- --with-md5-asm use md5 assembler sources
-
-+ --with-syslog use syslog instead of files to
log messages
-+
- --with-sha1=DIR set path to sha1 library sources
- --with-sha1-opt=OPTIONS set additional options for sha1
building
- --with-sha1-asm use sha1 assembler sources
-@@ -356,6 +364,8 @@
-
- --with-debug enable the debugging logging
-
-+ --with-syslog enable syslog support (disables
writing to file)
-+
- END
-
- exit 1
---- auto/summary.orig 2008-04-29 11:27:55.000000000 +0200
-+++ auto/summary 2008-05-16 11:12:43.000000000 +0200
-@@ -83,6 +83,11 @@
- *) echo " + using zlib library: $ZLIB" ;;
- esac
-
-+case $USE_SYSLOG in
-+ YES) echo " + using syslog" ;;
-+ *) echo " + syslog is not used" ;;
-+esac
-+
- echo
-
-
---- src/core/nginx.c.orig 2007-12-10 13:09:51.000000000 +0100
-+++ src/core/nginx.c 2008-05-16 11:12:43.000000000 +0200
-@@ -9,6 +9,9 @@
- #include <ngx_event.h>
- #include <nginx.h>
-
-+#ifdef USE_SYSLOG
-+#include <syslog.h>
-+#endif
-
- static ngx_int_t ngx_add_inherited_sockets(ngx_cycle_t *cycle);
- static ngx_int_t ngx_getopt(ngx_cycle_t *cycle, int argc, char *const
*argv);
-@@ -221,6 +224,11 @@
- ngx_ssl_init(log);
- #endif
-
-+ /* SYSLOG SUPPORT */
-+#ifdef USE_SYSLOG
-+ openlog("nginx", LOG_ODELAY, LOG_DAEMON);
-+#endif
-+
- /* init_cycle->log is required for signal handlers and ngx_getopt() */
-
- ngx_memzero(&init_cycle, sizeof(ngx_cycle_t));
-@@ -358,6 +366,10 @@
- ngx_single_process_cycle(cycle);
- }
-
-+#ifdef USE_SYSLOG
-+ closelog();
-+#endif
-+
- return 0;
- }
-
---- src/core/ngx_conf_file.c.orig 2008-04-29 11:28:42.000000000 +0200
-+++ src/core/ngx_conf_file.c 2008-05-16 11:12:43.000000000 +0200
-@@ -751,6 +751,11 @@
- full.data = NULL;
- #endif
-
-+#ifdef USE_SYSLOG
-+if (name) {
-+ name = NULL;
-+}
-+#endif
- if (name) {
- full = *name;
-
---- src/core/ngx_log.c.orig 2009-04-01 20:19:22.000000000 +0400
-+++ src/core/ngx_log.c 2009-04-25 19:45:12.992533679 +0400
-@@ -7,6 +7,9 @@
- #include <ngx_config.h>
- #include <ngx_core.h>
-
-+#ifdef USE_SYSLOG
-+#include <syslog.h>
-+#endif
-
- static char *ngx_set_error_log(ngx_conf_t *cf, ngx_command_t *cmd, void
*conf);
-
-@@ -81,17 +84,22 @@
- #endif
- u_char errstr[NGX_MAX_ERROR_STR], *p, *last;
-
-+#ifndef USE_SYSLOG
- if (log->file->fd == NGX_INVALID_FILE) {
- return;
- }
-+#endif
-
- last = errstr + NGX_MAX_ERROR_STR;
-
-+#ifdef USE_SYSLOG
-+ p = errstr;
-+#else
- ngx_memcpy(errstr, ngx_cached_err_log_time.data,
- ngx_cached_err_log_time.len);
-
- p = errstr + ngx_cached_err_log_time.len;
--
-+#endif
- p = ngx_snprintf(p, last - p, " [%s] ", err_levels[level]);
-
- /* pid#tid */
-@@ -150,7 +158,22 @@
-
- ngx_linefeed(p);
-
-+#ifdef USE_SYSLOG
-+ /* allocate a string which can hold the error message */
-+ char *syslogstr;
-+
-+ if ((syslogstr = calloc((p - errstr + 1), sizeof(char))) != NULL)
-+ {
-+ strncpy(syslogstr, errstr, p - errstr);
-+
-+ /* write to syslog */
-+ syslog(LOG_CRIT, "%s", syslogstr);
-+
-+ free(syslogstr);
-+ }
-+#else
- (void) ngx_write_fd(log->file->fd, errstr, p - errstr);
-+#endif
- }
-
-
-@@ -234,6 +257,9 @@
- ngx_log_t *log;
- ngx_str_t *value, *name;
-
-+#ifdef USE_SYSLOG
-+ name = value = NULL;
-+#else
- if (args) {
- value = args->elts;
- name = &value[1];
-@@ -241,6 +267,7 @@
- } else {
- name = NULL;
- }
-+#endif
-
- log = ngx_pcalloc(cycle->pool, sizeof(ngx_log_t));
- if (log == NULL) {
---- src/http/modules/ngx_http_log_module.c.orig 2007-11-15
15:26:36.000000000 +0100
-+++ src/http/modules/ngx_http_log_module.c 2008-05-16 11:56:39.000000000
+0200
-@@ -9,6 +9,9 @@
- #include <ngx_http.h>
- #include <nginx.h>
-
-+#ifdef USE_SYSLOG
-+#include <syslog.h>
-+#endif
-
- typedef struct ngx_http_log_op_s ngx_http_log_op_t;
-
-@@ -160,7 +163,11 @@
-
-
- static ngx_str_t ngx_http_combined_fmt =
-+#ifdef USE_SYSLOG
-+ ngx_string("$remote_addr - $remote_user "
-+#else
- ngx_string("$remote_addr - $remote_user [$time_local] "
-+#endif
- "\"$request\" $status $body_bytes_sent "
- "\"$http_referer\" \"$http_user_agent\"");
-
-@@ -285,6 +292,20 @@
- ngx_http_log_write(ngx_http_request_t *r, ngx_http_log_t *log, u_char *buf,
- size_t len)
- {
-+#ifdef USE_SYSLOG
-+ /* allocate a string which can hold the error message */
-+ char *syslogstr;
-+
-+ if ((syslogstr = calloc((len + 1), sizeof(char))) != NULL)
-+ {
-+ strncpy(syslogstr, buf, len);
-+
-+ /* write to syslog */
-+ syslog(LOG_NOTICE, "%s", syslogstr);
-+
-+ free(syslogstr);
-+ }
-+#else
- time_t now;
- ssize_t n;
- ngx_err_t err;
-@@ -322,6 +343,7 @@
-
- log->error_log_time = now;
- }
-+#endif
- }
-
-
-@@ -654,7 +676,11 @@
- return NGX_CONF_ERROR;
- }
-
-+#ifdef USE_SYLOG
-+ log->file = ngx_conf_open_file(cf->cycle, NULL);
-+#else
- log->file = ngx_conf_open_file(cf->cycle, &ngx_http_access_log);
-+#endif
- if (log->file == NULL) {
- return NGX_CONF_ERROR;
- }
-@@ -706,7 +732,11 @@
- return NGX_CONF_ERROR;
- }
-
-+#ifdef USE_SYSLOG
-+ log->file = ngx_conf_open_file(cf->cycle, NULL);
-+#else
- log->file = ngx_conf_open_file(cf->cycle, &value[1]);
-+#endif
- if (log->file == NULL) {
- return NGX_CONF_ERROR;
- }



  • [SM-Commit] GIT changes to master grimoire by Vlad Glagolev (766eb83e02cbc3c1d5a57e362d1248d1ec2c3a1b), Vlad Glagolev, 08/07/2009

Archive powered by MHonArc 2.6.24.

Top of Page