aboutsummaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
authorKaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>2014-01-01 12:45:29 +0200
committerKaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>2014-01-01 12:45:54 +0200
commitf9707eb97a564b162f5599980edc456768ac25df (patch)
tree91668b82e190ba6dab5d192b3d5a1a41853cb792 /testing
parent157e38bfbb80daadeea3df319acaa6a098a7c280 (diff)
downloadaports-f9707eb97a564b162f5599980edc456768ac25df.tar.bz2
aports-f9707eb97a564b162f5599980edc456768ac25df.tar.xz
testing/uwsgi: close listening socket when spawning
Diffstat (limited to 'testing')
-rw-r--r--testing/uwsgi/0001-core-socket-close-TCP-server-fd-when-spawning.patch27
-rw-r--r--testing/uwsgi/APKBUILD12
2 files changed, 35 insertions, 4 deletions
diff --git a/testing/uwsgi/0001-core-socket-close-TCP-server-fd-when-spawning.patch b/testing/uwsgi/0001-core-socket-close-TCP-server-fd-when-spawning.patch
new file mode 100644
index 0000000000..00a6abc84c
--- /dev/null
+++ b/testing/uwsgi/0001-core-socket-close-TCP-server-fd-when-spawning.patch
@@ -0,0 +1,27 @@
+From 015cf2049c6cbd90ebdd219e391735459b9a4c8d Mon Sep 17 00:00:00 2001
+From: Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>
+Date: Wed, 1 Jan 2014 03:51:56 +0200
+Subject: [PATCH] core/socket: close TCP server fd when spawning
+
+If server fd is not closed, it is not possible to restart uwsgi if the
+spawned process is still running as it keeps the address/port bound.
+---
+ core/socket.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/core/socket.c b/core/socket.c
+index 0696eff..2325cbf 100644
+--- a/core/socket.c
++++ b/core/socket.c
+@@ -674,6 +674,8 @@ int bind_to_tcp(char *socket_name, int listen_queue, char *tcp_port) {
+ return -1;
+ }
+
++ if (fcntl(serverfd, F_SETFD, FD_CLOEXEC) < 0) uwsgi_error("fcntl()");
++
+ if (uwsgi.so_sndbuf) {
+ socklen_t sndbuf = (socklen_t) uwsgi.so_sndbuf;
+ if (setsockopt(serverfd, SOL_SOCKET, SO_SNDBUF, &sndbuf, sizeof(socklen_t)) < 0) {
+--
+1.8.4.2
+
diff --git a/testing/uwsgi/APKBUILD b/testing/uwsgi/APKBUILD
index c12f602726..445ddc0d0d 100644
--- a/testing/uwsgi/APKBUILD
+++ b/testing/uwsgi/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=uwsgi
pkgver=1.9.20
-pkgrel=2
+pkgrel=3
pkgdesc="uWSGI application container server"
url=http://projects.unbit.it/uwsgi/
arch=all
@@ -11,6 +11,7 @@ makedepends="linux-headers lua5.2-dev python python-dev zeromq-dev paxctl
pcre-dev"
source="http://projects.unbit.it/downloads/uwsgi-${pkgver}.tar.gz
uwsgi.initd uwsgi.confd
+ 0001-core-socket-close-TCP-server-fd-when-spawning.patch
"
_plugins="lua python router_uwsgi"
@@ -76,10 +77,13 @@ done
md5sums="7ba1ef65e0678b6507e52dcabd158a61 uwsgi-1.9.20.tar.gz
8a8be061d7b5f3108a0f16813da68389 uwsgi.initd
-3d6afe6a8c52556d1d6c52384fc38d9a uwsgi.confd"
+3d6afe6a8c52556d1d6c52384fc38d9a uwsgi.confd
+02481e034587e63c5a0203c53ffd892a 0001-core-socket-close-TCP-server-fd-when-spawning.patch"
sha256sums="1a0e47c051f0490c0083717d018964ed0dbe546283f2d7fb628aebb85af39e8e uwsgi-1.9.20.tar.gz
58b998b025e4a9df20ca917bc93e287f9a8cf02d278d513fa461f70e1d08f799 uwsgi.initd
-4cb047e311aecd0f498da1d6a4c0947dd6dc7cc98575d54cb2ef150cacf8425c uwsgi.confd"
+4cb047e311aecd0f498da1d6a4c0947dd6dc7cc98575d54cb2ef150cacf8425c uwsgi.confd
+09b6bf027e179983d2390cfbb18ae7c2cce368deac76df06af7b3a7f70010eb5 0001-core-socket-close-TCP-server-fd-when-spawning.patch"
sha512sums="72d9b3d8107496fe405a435f6f9554ee841764b46918497e6aa2c928a4b8fe0bb520aa4edf72c3c9facbfa9cd88706277c8224e315a1b73d9e4a78bd37b9a7a0 uwsgi-1.9.20.tar.gz
ab9dc6277bd05821287f6f8beb3ac2504f0e41db38e11b4d2884ac026f14ac7bfaaca138f045afa712d4f2843f94de105bf0d43fad35d18679ac33b507cd187e uwsgi.initd
-9f00afb2aa574bbc59040f945475712b8c40da0c06eeb5699de5510aa116148e35ab0429fa891084cf0cd7868876d5a80e1601b7c85d0e2e9ea2a1f54cdde619 uwsgi.confd"
+9f00afb2aa574bbc59040f945475712b8c40da0c06eeb5699de5510aa116148e35ab0429fa891084cf0cd7868876d5a80e1601b7c85d0e2e9ea2a1f54cdde619 uwsgi.confd
+ec371dd534aa05a9a90ccebd02d1d76c49d3b5424a44f32be67d9ff9af69ae5d39f30f5744ab7c3e21542cb667840243d8fa30b8ad23845e0c46c22c19cc58c6 0001-core-socket-close-TCP-server-fd-when-spawning.patch"