From owner-svn-ports-all@freebsd.org Mon Apr 30 13:17:52 2018 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D4F3FAAD7F; Mon, 30 Apr 2018 13:17:52 +0000 (UTC) (envelope-from riggs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F20927BC1C; Mon, 30 Apr 2018 13:17:51 +0000 (UTC) (envelope-from riggs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D420F13AB2; Mon, 30 Apr 2018 13:17:51 +0000 (UTC) (envelope-from riggs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3UDHpqN091701; Mon, 30 Apr 2018 13:17:51 GMT (envelope-from riggs@FreeBSD.org) Received: (from riggs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3UDHp2M091699; Mon, 30 Apr 2018 13:17:51 GMT (envelope-from riggs@FreeBSD.org) Message-Id: <201804301317.w3UDHp2M091699@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: riggs set sender to riggs@FreeBSD.org using -f From: Thomas Zander Date: Mon, 30 Apr 2018 13:17:51 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r468698 - in head/databases/mongodb34: . files X-SVN-Group: ports-head X-SVN-Commit-Author: riggs X-SVN-Commit-Paths: in head/databases/mongodb34: . files X-SVN-Commit-Revision: 468698 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Apr 2018 13:17:52 -0000 Author: riggs Date: Mon Apr 30 13:17:51 2018 New Revision: 468698 URL: https://svnweb.freebsd.org/changeset/ports/468698 Log: Adapt mongod_limits to the new resource limiting mechanics for services PR: 227215 Submitted by: 0mp Approved by: eric@camachat.org (maintainer) Modified: head/databases/mongodb34/Makefile head/databases/mongodb34/files/mongod.in Modified: head/databases/mongodb34/Makefile ============================================================================== --- head/databases/mongodb34/Makefile Mon Apr 30 13:12:56 2018 (r468697) +++ head/databases/mongodb34/Makefile Mon Apr 30 13:17:51 2018 (r468698) @@ -3,7 +3,7 @@ PORTNAME= mongodb DISTVERSIONPREFIX= r DISTVERSION= 3.4.9 -PORTREVISION= 3 +PORTREVISION= 4 CATEGORIES= databases net MASTER_SITES= https://fastdl.mongodb.org/src/ \ http://fastdl.mongodb.org/src/ \ @@ -57,6 +57,14 @@ SASL_MAKE_ARGS= --use-sasl-client SSL_USES= ssl SSL_MAKE_ARGS= --ssl + +.include + +.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/mongodb34/files/mongod.in ============================================================================== --- head/databases/mongodb34/files/mongod.in Mon Apr 30 13:12:56 2018 (r468697) +++ head/databases/mongodb34/files/mongod.in Mon Apr 30 13:17:51 2018 (r468698) @@ -9,9 +9,9 @@ # # 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"} @@ -51,11 +51,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"