Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 May 2018 09:24:10 +0000 (UTC)
From:      Thomas Zander <riggs@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r470445 - in head/databases/mongodb32: . files
Message-ID:  <201805200924.w4K9OAqp018082@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: riggs
Date: Sun May 20 09:24:10 2018
New Revision: 470445
URL: https://svnweb.freebsd.org/changeset/ports/470445

Log:
  Adapt ${name}_limits to the new resource limiting mechanics for services
  
  PR:		227218
  Submitted by:	0mp

Modified:
  head/databases/mongodb32/Makefile
  head/databases/mongodb32/files/mongod.in

Modified: head/databases/mongodb32/Makefile
==============================================================================
--- head/databases/mongodb32/Makefile	Sun May 20 09:04:10 2018	(r470444)
+++ head/databases/mongodb32/Makefile	Sun May 20 09:24:10 2018	(r470445)
@@ -3,7 +3,7 @@
 
 PORTNAME=	mongodb32
 PORTVERSION=	3.2.11
-PORTREVISION=	1
+PORTREVISION=	2
 DISTVERSIONPREFIX=	r
 CATEGORIES=	databases net
 MASTER_SITES=	https://fastdl.mongodb.org/src/ \
@@ -50,6 +50,14 @@ USERS=	mongodb
 GROUPS=	mongodb
 
 USE_RC_SUBR=	mongod
+
+.include <bsd.port.options.mk>
+
+.if ${OPSYS} == FreeBSD && ${OSVERSION} >= 1200057
+SUB_LIST+=	LEGACY_LIMITS="@comment " MODERN_LIMITS=""
+.else
+SUB_LIST+=	LEGACY_LIMITS="" MODERN_LIMITS="@comment "
+.endif
 
 ALL_TARGET=	core
 TEST_TARGET=	unittests

Modified: head/databases/mongodb32/files/mongod.in
==============================================================================
--- head/databases/mongodb32/files/mongod.in	Sun May 20 09:04:10 2018	(r470444)
+++ head/databases/mongodb32/files/mongod.in	Sun May 20 09:24:10 2018	(r470445)
@@ -7,11 +7,11 @@
 # Add the following lines to /etc/rc.conf.local or /etc/rc.conf
 # to enable this service:
 #
-# mongod_enable (bool):  Set to "NO" by default.                                                                                                                                                                                             
+# mongod_enable (bool):  Set to "NO" by default.
 #                        Set it to "YES" to enable mongod.
-# mongod_limits (bool):  Set to "NO" by default.
-#                        Set it to yes to run `limits -e -U mongodb`
-#                        just before mongod starts.
+%%LEGACY_LIMITS%%# mongod_limits (bool):  Set to "NO" by default.
+%%LEGACY_LIMITS%%#                        Set it to yes to run `limits -e -U mongodb`
+%%LEGACY_LIMITS%%#                        just before mongod starts.
 # mongod_dbpath (str):   Default to "/var/db/mongodb"
 #                        Base database directory.
 # mongod_flags (str):    Custom additional arguments to be passed to mongod.
@@ -28,7 +28,7 @@ rcvar=mongod_enable
 load_rc_config $name
 
 : ${mongod_enable="NO"}
-: ${mongod_limits="NO"}
+%%LEGACY_LIMITS%%: ${mongod_limits="NO"}
 : ${mongod_dbpath="/var/db/mongodb"}
 : ${mongod_flags="--logpath ${mongod_dbpath}/mongod.log --logappend"}
 : ${mongod_user="mongodb"}
@@ -52,11 +52,12 @@ mongod_prestart()
         if [ ! -d ${mongod_dbpath} ]; then
                 mongod_create_dbpath || return 1
         fi
-        if checkyesno mongod_limits; then
-                eval `/usr/bin/limits -e -U ${mongod_user}` 2>/dev/null
-        else
-                return 0
-        fi
+%%LEGACY_LIMITS%%        if checkyesno mongod_limits; then
+%%LEGACY_LIMITS%%                eval `/usr/bin/limits -e -U ${mongod_user}` 2>/dev/null
+%%LEGACY_LIMITS%%        else
+%%LEGACY_LIMITS%%                return 0
+%%LEGACY_LIMITS%%        fi
+%%MODERN_LIMITS%%        return 0
 }
 
 run_rc_command "$1"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201805200924.w4K9OAqp018082>