diff options
author | wiz <wiz@pkgsrc.org> | 2022-04-29 13:05:35 +0000 |
---|---|---|
committer | wiz <wiz@pkgsrc.org> | 2022-04-29 13:05:35 +0000 |
commit | 07a523ffa881edca85868687eddb71f14c442bc7 (patch) | |
tree | 5a075e726d4b941cb5b72e358adce8cbb8115717 /net/py-ephemeral_port_reserve | |
parent | 4f4673e92c116c7f65a126ab92e1dacfa4cd887d (diff) | |
download | pkgsrc-07a523ffa881edca85868687eddb71f14c442bc7.tar.gz |
net/py-ephemeral_port_reserve: import py-ephemeral_port_reserve-1.1.4
Sometimes you need a networked program to bind to a port that can't
be hard-coded. Generally this is when you want to run several of
them in parallel; if they all bind to port 8080, only one of them
can succeed.
The usual solution is the "port 0 trick". If you bind to port 0,
your kernel will find some arbitrary high-numbered port that's
unused and bind to that. Afterward you can query the actual port
that was bound to if you need to use the port number elsewhere.
However, there are cases where the port 0 trick won't work. For
example, mysqld takes port 0 to mean "the port configured in my.cnf".
Docker can bind your containers to port 0, but uses its own
implementation to find a free port which races and fails in the
face of parallelism.
ephemeral-port-reserve provides an implementation of the port 0
trick which is reliable and race-free.
Diffstat (limited to 'net/py-ephemeral_port_reserve')
-rw-r--r-- | net/py-ephemeral_port_reserve/ALTERNATIVES | 1 | ||||
-rw-r--r-- | net/py-ephemeral_port_reserve/DESCR | 17 | ||||
-rw-r--r-- | net/py-ephemeral_port_reserve/Makefile | 17 | ||||
-rw-r--r-- | net/py-ephemeral_port_reserve/PLIST | 10 | ||||
-rw-r--r-- | net/py-ephemeral_port_reserve/distinfo | 5 |
5 files changed, 50 insertions, 0 deletions
diff --git a/net/py-ephemeral_port_reserve/ALTERNATIVES b/net/py-ephemeral_port_reserve/ALTERNATIVES new file mode 100644 index 00000000000..2a76ecd1b43 --- /dev/null +++ b/net/py-ephemeral_port_reserve/ALTERNATIVES @@ -0,0 +1 @@ +bin/ephemeral-port-reserve @PREFIX@/bin/ephemeral-port-reserve-@PYVERSSUFFIX@ diff --git a/net/py-ephemeral_port_reserve/DESCR b/net/py-ephemeral_port_reserve/DESCR new file mode 100644 index 00000000000..2123bad4deb --- /dev/null +++ b/net/py-ephemeral_port_reserve/DESCR @@ -0,0 +1,17 @@ +Sometimes you need a networked program to bind to a port that can't +be hard-coded. Generally this is when you want to run several of +them in parallel; if they all bind to port 8080, only one of them +can succeed. + +The usual solution is the "port 0 trick". If you bind to port 0, +your kernel will find some arbitrary high-numbered port that's +unused and bind to that. Afterward you can query the actual port +that was bound to if you need to use the port number elsewhere. +However, there are cases where the port 0 trick won't work. For +example, mysqld takes port 0 to mean "the port configured in my.cnf". +Docker can bind your containers to port 0, but uses its own +implementation to find a free port which races and fails in the +face of parallelism. + +ephemeral-port-reserve provides an implementation of the port 0 +trick which is reliable and race-free. diff --git a/net/py-ephemeral_port_reserve/Makefile b/net/py-ephemeral_port_reserve/Makefile new file mode 100644 index 00000000000..6db419a2c8f --- /dev/null +++ b/net/py-ephemeral_port_reserve/Makefile @@ -0,0 +1,17 @@ +# $NetBSD: Makefile,v 1.1 2022/04/29 13:05:35 wiz Exp $ + +DISTNAME= ephemeral_port_reserve-1.1.4 +PKGNAME= ${PYPKGPREFIX}-${DISTNAME} +CATEGORIES= net python +MASTER_SITES= ${MASTER_SITE_PYPI:=e/ephemeral_port_reserve/} + +MAINTAINER= pkgsrc-users@NetBSD.org +HOMEPAGE= https://github.com/Yelp/ephemeral-port-reserve/ +COMMENT= Bind to ephemeral port, force it into TIME_WAIT state, and unbind it +LICENSE= mit + +post-install: + ${MV} ${DESTDIR}${PREFIX}/bin/ephemeral-port-reserve ${DESTDIR}${PREFIX}/bin/ephemeral-port-reserve-${PYVERSSUFFIX} || ${TRUE} + +.include "../../lang/python/egg.mk" +.include "../../mk/bsd.pkg.mk" diff --git a/net/py-ephemeral_port_reserve/PLIST b/net/py-ephemeral_port_reserve/PLIST new file mode 100644 index 00000000000..9566018f345 --- /dev/null +++ b/net/py-ephemeral_port_reserve/PLIST @@ -0,0 +1,10 @@ +@comment $NetBSD: PLIST,v 1.1 2022/04/29 13:05:35 wiz Exp $ +bin/ephemeral-port-reserve-${PYVERSSUFFIX} +${PYSITELIB}/${EGG_INFODIR}/PKG-INFO +${PYSITELIB}/${EGG_INFODIR}/SOURCES.txt +${PYSITELIB}/${EGG_INFODIR}/dependency_links.txt +${PYSITELIB}/${EGG_INFODIR}/entry_points.txt +${PYSITELIB}/${EGG_INFODIR}/top_level.txt +${PYSITELIB}/ephemeral_port_reserve.py +${PYSITELIB}/ephemeral_port_reserve.pyc +${PYSITELIB}/ephemeral_port_reserve.pyo diff --git a/net/py-ephemeral_port_reserve/distinfo b/net/py-ephemeral_port_reserve/distinfo new file mode 100644 index 00000000000..c853b1a3b88 --- /dev/null +++ b/net/py-ephemeral_port_reserve/distinfo @@ -0,0 +1,5 @@ +$NetBSD: distinfo,v 1.1 2022/04/29 13:05:35 wiz Exp $ + +BLAKE2s (ephemeral_port_reserve-1.1.4.tar.gz) = 8f6af493ce79d9655a2a1eac52b026c977f868708f34110a88e83e3693cb070f +SHA512 (ephemeral_port_reserve-1.1.4.tar.gz) = 7a406d092ddaeca28e55a6e0a367f10f21b635e3c32571b304453b86df0a852fb91a9b12619f300833ee58d6ef5aafcd7338801eeb7d330ad43c4f2caa14d50f +Size (ephemeral_port_reserve-1.1.4.tar.gz) = 3541 bytes |