FreeBSD Bugzilla – Attachment 250074 Details for
Bug 278447
www/py-gunicorn: add rc file and sample config
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
[PATCH] www/py-gunicorn: add rc file and sample config
0001-www-py-gunicorn-add-rc-file-and-sample-config.patch (text/plain), 4.44 KB, created by
Siva Mahadevan
on 2024-04-19 01:03:33 UTC
(
hide
)
Description:
[PATCH] www/py-gunicorn: add rc file and sample config
Filename:
MIME Type:
Creator:
Siva Mahadevan
Created:
2024-04-19 01:03:33 UTC
Size:
4.44 KB
patch
obsolete
>From dfe35b1b3c84eab953dba8a8ab86eea0103955ca Mon Sep 17 00:00:00 2001 >From: Siva Mahadevan <me@svmhdvn.name> >Date: Thu, 18 Apr 2024 20:55:10 -0400 >Subject: [PATCH] www/py-gunicorn: add rc file and sample config > >--- > GIDs | 2 +- > UIDs | 2 +- > www/py-gunicorn/Makefile | 11 ++++++- > www/py-gunicorn/files/gunicorn.conf.py | 8 ++++++ > www/py-gunicorn/files/gunicorn.in | 40 ++++++++++++++++++++++++++ > www/py-gunicorn/pkg-plist | 1 + > 6 files changed, 61 insertions(+), 3 deletions(-) > create mode 100644 www/py-gunicorn/files/gunicorn.conf.py > create mode 100644 www/py-gunicorn/files/gunicorn.in > create mode 100644 www/py-gunicorn/pkg-plist > >diff --git a/GIDs b/GIDs >index e6634767c5b1..c406ff64d990 100644 >--- a/GIDs >+++ b/GIDs >@@ -283,7 +283,7 @@ mumble-server:*:339: > wildfire:*:340: > stunnel:*:341: > openfire:*:342: >-# free: 343 >+gunicorn:*:343: > # free: 344 > # free: 345 > # free: 346 >diff --git a/UIDs b/UIDs >index 884fe4724496..6c7bb79453ba 100644 >--- a/UIDs >+++ b/UIDs >@@ -288,7 +288,7 @@ mumble-server:*:339:339::0:0:& User:/nonexistent:/usr/sbin/nologin > wildfire:*:340:340::0:0:Wildfire Daemon:/nonexistent:/usr/sbin/nologin > stunnel:*:341:341::0:0:Stunnel Daemon:/nonexistent:/usr/sbin/nologin > openfire:*:342:342::0:0:Openfire IM Daemon:/nonexistent:/usr/sbin/nologin >-# free: 343 >+gunicorn:*:343:343::0:0:Gunicorn Daemon:/nonexistent:/usr/sbin/nologin > # free: 344 > # free: 345 > # free: 346 >diff --git a/www/py-gunicorn/Makefile b/www/py-gunicorn/Makefile >index 95024a4562ed..c24a4c90396d 100644 >--- a/www/py-gunicorn/Makefile >+++ b/www/py-gunicorn/Makefile >@@ -1,6 +1,6 @@ > PORTNAME= gunicorn > PORTVERSION= 21.2.0 >-PORTREVISION= 1 >+PORTREVISION= 2 > CATEGORIES= www python > PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} > MASTER_SITES= PYPI >@@ -8,6 +8,9 @@ MASTER_SITES= PYPI > MAINTAINER= bofh@FreeBSD.org > COMMENT= WSGI HTTP Server for UNIX > WWW= https://gunicorn.org/ >+USERS= gunicorn >+GROUPS= gunicorn >+USE_RC_SUBR= gunicorn > > LICENSE= MIT > LICENSE_FILE= ${WRKSRC}/LICENSE >@@ -20,6 +23,8 @@ USE_PYTHON= autoplist concurrent distutils pytest > > NO_ARCH= yes > >+SUB_LIST= USERS="${USERS}" GROUPS="${GROUPS}" >+ > OPTIONS_DEFINE= PROCTITLE > OPTIONS_DEFAULT= PROCTITLE > OPTIONS_GROUP= WORKERS >@@ -35,4 +40,8 @@ GEVENT_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}gevent>=1.4.0:devel/py-gevent@${PY_FL > PROCTITLE_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}setproctitle>0:devel/py-setproctitle@${PY_FLAVOR} > TORNADO_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}tornado>=0.2:www/py-tornado@${PY_FLAVOR} > >+post-install: >+ @${MKDIR} ${STAGEDIR}/${ETCDIR} >+ ${INSTALL_DATA} files/gunicorn.conf.py ${STAGEDIR}/${ETCDIR}/gunicorn.conf.py.sample >+ > .include <bsd.port.mk> >diff --git a/www/py-gunicorn/files/gunicorn.conf.py b/www/py-gunicorn/files/gunicorn.conf.py >new file mode 100644 >index 000000000000..c51356f1087b >--- /dev/null >+++ b/www/py-gunicorn/files/gunicorn.conf.py >@@ -0,0 +1,8 @@ >+# Sample Gunicorn configuration file. >+# For more information, see >+# https://docs.gunicorn.org/en/stable/configure.html#configuration-file >+ >+import multiprocessing >+ >+bind = '127.0.0.1:8000' >+workers = multiprocessing.cpu_count() * 2 + 1 >diff --git a/www/py-gunicorn/files/gunicorn.in b/www/py-gunicorn/files/gunicorn.in >new file mode 100644 >index 000000000000..b1e6bdae1e5a >--- /dev/null >+++ b/www/py-gunicorn/files/gunicorn.in >@@ -0,0 +1,40 @@ >+#!/bin/sh >+# Created by: Siva Mahadevan <me@svmhdvn.name> >+ >+# PROVIDE: gunicorn >+# REQUIRE: DAEMON >+# BEFORE: LOGIN >+# KEYWORD: shutdown >+ >+# >+# Add the following lines to /etc/rc.conf to enable gunicorn: >+# gunicorn_enable (bool): Set to "NO" by default. >+# Set it to "YES" to enable gunicorn. >+# >+ >+. /etc/rc.subr >+ >+name=gunicorn >+rcvar=gunicorn_enable >+ >+# set defaults >+ >+load_rc_config $name >+ >+: ${gunicorn_enable:=NO} >+: ${gunicorn_config=%%ETCDIR%%/gunicorn.conf.py} >+: ${gunicorn_user=%%USERS%%} >+: ${gunicorn_group=%%GROUPS%%} >+ >+pidfile="/var/run/${name}.pid" >+command=/usr/sbin/daemon >+command_args="-P ${pidfile} -f -ST ${name} %%PREFIX%%/bin/gunicorn -c ${gunicorn_config}" >+required_files="${gunicorn_config}" >+start_precmd="gunicorn_precmd" >+ >+gunicorn_precmd() >+{ >+ install -o ${gunicorn_user} /dev/null ${pidfile} >+} >+ >+run_rc_command "$1" >diff --git a/www/py-gunicorn/pkg-plist b/www/py-gunicorn/pkg-plist >new file mode 100644 >index 000000000000..65ca4fcbc824 >--- /dev/null >+++ b/www/py-gunicorn/pkg-plist >@@ -0,0 +1 @@ >+@sample %%ETCDIR%%/gunicorn.conf.py.sample >-- >2.44.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
me
:
maintainer-approval?
Actions:
View
|
Diff
Attachments on
bug 278447
: 250074