Adapt ${name}_limits to the new resource limiting mechanics for services

While on it:
- Pet portlint

PR:		227221
Submitted by:	0mp
Approved by:	maintainer timeout
This commit is contained in:
Thomas Zander 2018-06-09 19:25:56 +00:00
parent e11a8dec8b
commit 826af1967d
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=472082
2 changed files with 21 additions and 11 deletions

View File

@ -3,10 +3,11 @@
PORTNAME= arangodb
DISTVERSIONPREFIX= v
DISTVERSION= 3.3.7
PORTREVISION= 1
CATEGORIES= databases net
PKGNAMESUFFIX= 33
MAINTAINER= dev@dudu.ro
MAINTAINER= dev@dudu.ro
COMMENT= ArangoDB is a distributed NoSQL database with multiple data models
LICENSE= APACHE20
@ -30,6 +31,14 @@ USERS= arangodb
GROUPS= arangodb
USE_RC_SUBR= arangod
.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
post-install:
.for section in 1 8
@${MV} ${STAGEDIR}${PREFIX}/share/man/man${section}/* ${STAGEDIR}${PREFIX}/man/man${section}/

View File

@ -9,13 +9,13 @@
#
# arangod_enable (bool): Set to "NO" by default.
# Set it to "YES" to enable arangod.
# arangod_limits (bool): Set to "NO" by default.
# Set it to yes to run `limits -e -U arangodb`
# just before arangod starts.
%%LEGACY_LIMITS%%# arangod_limits (bool): Set to "NO" by default.
%%LEGACY_LIMITS%%# Set it to yes to run `limits -e -U arangodb`
%%LEGACY_LIMITS%%# just before arangod starts.
# arangod_dbpath (str): Default to "/var/db/arangodb"
# Base database directory.
# arangod_logpath (str): Default to "/var/log/arangodb"
# Base logging directory
# Base logging directory
# arangod_apppath (str): Default to "/var/db/arangodb-apps"
# Base apps directory
# arangod_flags (str): Custom additional arguments to be passed to arangod.
@ -32,7 +32,7 @@ rcvar=arangod_enable
load_rc_config $name
: ${arangod_enable="NO"}
: ${arangod_limits="NO"}
%%LEGACY_LIMITS%%: ${arangod_limits="NO"}
: ${arangod_dbpath="/var/db/arangodb"}
: ${arangod_logpath="/var/log/arangodb"}
: ${arangod_apppath="/var/db/arangodb-apps"}
@ -75,11 +75,12 @@ arangod_prestart()
if [ ! -d ${arangod_apppath} ]; then
arangod_create_apppath || return 1
fi
if checkyesno arangod_limits; then
eval `/usr/bin/limits -e -U ${arangod_user}` 2>/dev/null
else
return 0
fi
%%LEGACY_LIMITS%% if checkyesno arangod_limits; then
%%LEGACY_LIMITS%% eval `/usr/bin/limits -e -U ${arangod_user}` 2>/dev/null
%%LEGACY_LIMITS%% else
%%LEGACY_LIMITS%% return 0
%%LEGACY_LIMITS%% fi
%%MODERN_LIMITS%% return 0
}
run_rc_command "$1"