From owner-svn-src-all@freebsd.org Thu Nov 10 07:05:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94809C390C7; Thu, 10 Nov 2016 07:05:42 +0000 (UTC) (envelope-from araujo@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 mx1.freebsd.org (Postfix) with ESMTPS id 65D3ABB4; Thu, 10 Nov 2016 07:05:42 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAA75fnQ011253; Thu, 10 Nov 2016 07:05:41 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAA75ffM011252; Thu, 10 Nov 2016 07:05:41 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201611100705.uAA75ffM011252@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Thu, 10 Nov 2016 07:05:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308478 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Nov 2016 07:05:42 -0000 Author: araujo Date: Thu Nov 10 07:05:41 2016 New Revision: 308478 URL: https://svnweb.freebsd.org/changeset/base/308478 Log: We can't use protect(1) inside a jail(8)! To avoid have warning for services that are using oomprotect, oomprotect will only be applied on services that won't run inside jails. Reported by: allanjude MFC after: 2 weeks. Modified: head/etc/rc.subr Modified: head/etc/rc.subr ============================================================================== --- head/etc/rc.subr Wed Nov 9 21:51:48 2016 (r308477) +++ head/etc/rc.subr Thu Nov 10 07:05:41 2016 (r308478) @@ -1205,6 +1205,11 @@ $command $rc_flags $command_args" # Apply protect(1) to the PID if ${name}_oomprotect is set. case "$rc_arg" in start) + # We cannot use protect(1) inside jails. + jailed="$(sysctl -n security.jail.jailed)" + if [ ${jailed} -eq 1 ]; then + return $_return + fi if [ -n "$_oomprotect" ]; then if [ -f "${PROTECT}" ]; then pid=$(check_process $command)