nginx1.10.2 patch失败
patch -p1 < /usr/local/src/nginx_upstream_check_module-master/check_1.11.1+.patch can't find file to patch at input line 4 Perhaps you used the wrong -p or --strip option? The text leading up to this was:
|diff --git src/http/modules/ngx_http_upstream_hash_module.c src/http/modules/ngx_http_upstream_hash_module.c |--- src/http/modules/ngx_http_upstream_hash_module.c 2016-05-31 15:43:51.000000000 +0200 |+++ src/http/modules/ngx_http_upstream_hash_module.c 2016-06-22 17:20:19.553955295 +0200
试了一下-p0也是失败,有几个文件也是编译失败: patch -p0 < /usr/local/src/nginx_upstream_check_module-master/check_1.11.1+.patch patching file src/http/modules/ngx_http_upstream_hash_module.c Hunk #2 FAILED at 238. Hunk #3 FAILED at 538. 2 out of 3 hunks FAILED -- saving rejects to file src/http/modules/ngx_http_upstream_hash_module.c.rej patching file src/http/modules/ngx_http_upstream_ip_hash_module.c Hunk #1 succeeded at 12 with fuzz 2 (offset 3 lines). Hunk #2 succeeded at 329 with fuzz 2 (offset 121 lines). patching file src/http/modules/ngx_http_upstream_least_conn_module.c Hunk #1 succeeded at 12 with fuzz 2 (offset 3 lines). Hunk #2 succeeded at 297 with fuzz 2 (offset 145 lines). Hunk #3 succeeded at 438 with fuzz 2 (offset 225 lines). patching file src/http/ngx_http_upstream_round_robin.c Reversed (or previously applied) patch detected! Assume -R? [n] y
delete the directory uncompressed directory nginx-1.11.1 then tar -xzvf nginx-1.11.1.tar.gz cd nginx-1.11.1 patch -p0 < /usr/local/src/nginx_upstream_check_module-master/check_1.11.1+.patch have a try !
@cell13 that also worked for nginx 1.9.9
root@2294c0d36160:~/nginx-1.9.9# patch -p1 < /root/nginx_upstream_check_module/check_1.9.2+.patch
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git src/http/modules/ngx_http_upstream_hash_module.c src/http/modules/ngx_http_upstream_hash_module.c
|index 1e2e05c..44a72e2 100644
|--- src/http/modules/ngx_http_upstream_hash_module.c
|+++ src/http/modules/ngx_http_upstream_hash_module.c
--------------------------
File to patch: ^C
root@2294c0d36160:~/nginx-1.9.9#
root@2294c0d36160:~/nginx-1.9.9# patch -p0 < /root/nginx_upstream_check_module/check_1.9.2+.patch
patching file src/http/modules/ngx_http_upstream_hash_module.c
patching file src/http/modules/ngx_http_upstream_ip_hash_module.c
patching file src/http/modules/ngx_http_upstream_least_conn_module.c
patching file src/http/ngx_http_upstream_round_robin.c
patching file src/http/ngx_http_upstream_round_robin.h
root@2294c0d36160:~/nginx-1.9.9#
@vikas027 nginx-1.9.9 version is lower than nginx-1.10.2,when I use nginx-1.10.1, it's ok,can you try nginx 1.10.2?
@yangdailin I have also tried v1.10.2 with same issue while using patch -p1
root@box84:~/nginx-1.10.1# patch -p1 < /root/nginx_upstream_check_module/check_1.9.2+.patch
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git src/http/modules/ngx_http_upstream_hash_module.c src/http/modules/ngx_http_upstream_hash_module.c
|index 1e2e05c..44a72e2 100644
|--- src/http/modules/ngx_http_upstream_hash_module.c
|+++ src/http/modules/ngx_http_upstream_hash_module.c
--------------------------
File to patch: ^C
root@box84:~/nginx-1.10.1#
root@box84:~/nginx-1.10.1# patch -p0 < /root/nginx_upstream_check_module/check_1.9.2+.patch
patching file src/http/modules/ngx_http_upstream_hash_module.c
patching file src/http/modules/ngx_http_upstream_ip_hash_module.c
patching file src/http/modules/ngx_http_upstream_least_conn_module.c
patching file src/http/ngx_http_upstream_round_robin.c
patching file src/http/ngx_http_upstream_round_robin.h
root@box84:~/nginx-1.10.1#
nginx-1.9.9 is ok! The problem is the using of patch command. Below is a simple script, you can have a try.
cd /opt/src
#download nginx-1.9.9.tar.gz
wget http://nginx.org/download/nginx-1.9.9.tar.gz
# nginx-1.9.9
tar -xzvf nginx-1.9.9.tar.gz
wget https://github.com/yaoweibin/nginx_upstream_check_module/archive/master.zip
unzip master
cd nginx-1.9.9
patch -p0 < ../nginx_upstream_check_module-master/check_1.9.2+.patch
@vikas027 1.10.1 is ok, but 1.10.2 is not
我现在使用的就是nginx1.10.2 ,设置剥离层级为0,patch -p0 < ../nginx_upstream_check_module-master/check_1.9.2+.patch 之后就可以成功打上补丁

我TCP的check是OK的,但是http的check 死活都检测不到,我后端是的服务器可以抓到包,但是发送的检查协议却是TCP的,不知道是不是有问题的
@liuwenru the real server is website or other application. Is there any error information?

i use the debug level log , it only tell me about this , my real serve is a web application ! , i can use the tcpdump in the real serve cache the package what is a health check.

NGINX 1.16.1 -=> patch -p0 < $BUILD_ROOT/nginx_upstream_check/check_1.16.1+.patch
can't find file to patch at input line 4
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -burN nginx-1.14.0.orig/src/http/modules/ngx_http_upstream_hash_module.c nginx-1.14.0/src/http/modules/ngx_http_upstream_hash_module.c
|--- nginx-1.14.0.orig/src/http/modules/ngx_http_upstream_hash_module.c 2018-06-28 21:30:48.891580738 +0000
|+++ nginx-1.14.0/src/http/modules/ngx_http_upstream_hash_module.c 2018-06-28 21:40:41.801180483 +0000
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
3 out of 3 hunks ignored
can't find file to patch at input line 48
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -burN nginx-1.14.0.orig/src/http/modules/ngx_http_upstream_ip_hash_module.c nginx-1.14.0/src/http/modules/ngx_http_upstream_ip_hash_module.c
|--- nginx-1.14.0.orig/src/http/modules/ngx_http_upstream_ip_hash_module.c 2018-06-28 21:30:48.891580738 +0000
|+++ nginx-1.14.0/src/http/modules/ngx_http_upstream_ip_hash_module.c 2018-06-28 21:49:12.608780187 +0000
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
2 out of 2 hunks ignored
can't find file to patch at input line 77
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -burN nginx-1.14.0.orig/src/http/modules/ngx_http_upstream_least_conn_module.c nginx-1.14.0/src/http/modules/ngx_http_upstream_least_conn_module.c
|--- nginx-1.14.0.orig/src/http/modules/ngx_http_upstream_least_conn_module.c 2018-06-28 21:30:48.895580638 +0000
|+++ nginx-1.14.0/src/http/modules/ngx_http_upstream_least_conn_module.c 2018-06-28 21:50:48.542450442 +0000
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
3 out of 3 hunks ignored
can't find file to patch at input line 124
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -burN nginx-1.14.0.orig/src/http/ngx_http_upstream_round_robin.c nginx-1.14.0/src/http/ngx_http_upstream_round_robin.c
|--- nginx-1.14.0.orig/src/http/ngx_http_upstream_round_robin.c 2018-06-28 21:30:48.887580840 +0000
|+++ nginx-1.14.0/src/http/ngx_http_upstream_round_robin.c 2018-06-28 21:54:36.492914512 +0000
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
8 out of 8 hunks ignored
can't find file to patch at input line 226
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -burN nginx-1.14.0.orig/src/http/ngx_http_upstream_round_robin.h nginx-1.14.0/src/http/ngx_http_upstream_round_robin.h
|--- nginx-1.14.0.orig/src/http/ngx_http_upstream_round_robin.h 2018-06-28 21:30:48.895580638 +0000
|+++ nginx-1.14.0/src/http/ngx_http_upstream_round_robin.h 2018-06-28 21:55:13.036027376 +0000
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
1 out of 1 hunk ignored