From owner-svn-src-stable-11@freebsd.org Mon Apr 9 14:23:47 2018 Return-Path: Delivered-To: svn-src-stable-11@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 407D9F843AF; Mon, 9 Apr 2018 14:23:47 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: from mail-lf0-f66.google.com (mail-lf0-f66.google.com [209.85.215.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AF9C479D3A; Mon, 9 Apr 2018 14:23:46 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: by mail-lf0-f66.google.com with SMTP id q9-v6so6835885lfk.9; Mon, 09 Apr 2018 07:23:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=DHvm8bSuojJ4nBAae3KzlSPjh2sCYq3rLhLOOQoqvec=; b=hYy1/aY0zQ1+BZDe3KGUba1BlaXSvlxnApSBK45jcxNBSfIGA0mcstg1IJfmdk/P35 zJ4JrZ5heLV2lx47tmyZLCvg67XfWj6BfIR/VTyPXrHOvHhE/MMP95IAuHehNkjj1OJY 7quxghNEH/HB2csXwyvmDkBtCgvsp4KUImLLNj2NYlDZLDzHaVjExCPJz+Xic/tNZbq8 jincipO4w1ecgcXcVGvIhLeQelyyXP1mmBfptecUedCPkA7SSnNc+01LJpYBNs/NTT22 reJ3C6DLWV6TElQ8SJY2nZZUIvDuz+jvoZfqDWuADOD38or+7ZfTjjBoNIHTT0SVPd/X c2lQ== X-Gm-Message-State: ALQs6tBle1vzIZMDthA4R8ZmUF9kodKfOuhATMiJz9ErLaB3QPiO49Cq Qdg8V2e2UxKBzRYtSzTxhnNjKMmV X-Google-Smtp-Source: AIpwx4+4EWSuK22vXkv0qu/N9tg9mWNba7Cs1alXhrGHLM0O6mmfqzZDtSumA5FMFWUw+GmaHcZa4Q== X-Received: by 2002:a19:1a88:: with SMTP id a130-v6mr15517646lfa.7.1523283463809; Mon, 09 Apr 2018 07:17:43 -0700 (PDT) Received: from mail-lf0-f51.google.com (mail-lf0-f51.google.com. [209.85.215.51]) by smtp.gmail.com with ESMTPSA id q23sm89522ljh.10.2018.04.09.07.17.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Apr 2018 07:17:43 -0700 (PDT) Received: by mail-lf0-f51.google.com with SMTP id q5-v6so6818542lff.12; Mon, 09 Apr 2018 07:17:43 -0700 (PDT) X-Received: by 10.46.148.72 with SMTP id o8mr22873605ljh.74.1523283463543; Mon, 09 Apr 2018 07:17:43 -0700 (PDT) MIME-Version: 1.0 Received: by 10.46.129.90 with HTTP; Mon, 9 Apr 2018 07:17:22 -0700 (PDT) In-Reply-To: <9cfe34fc-196a-df96-7eaf-036cc4c17bdd@daemonic.se> References: <201804021539.w32FdaID083096@pdx.rh.CN85.dnsmgr.net> <9cfe34fc-196a-df96-7eaf-036cc4c17bdd@daemonic.se> From: Kyle Evans Date: Mon, 9 Apr 2018 09:17:22 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r331880 - stable/11/etc To: Niclas Zeising Cc: "Rodney W. Grimes" , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers , svn-src-stable-11@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2018 14:23:47 -0000 On Mon, Apr 9, 2018 at 9:04 AM, Niclas Zeising wrote: > On 04/02/18 17:39, Rodney W. Grimes wrote: >>> >>> Author: kevans >>> Date: Mon Apr 2 15:28:48 2018 >>> New Revision: 331880 >>> URL: https://svnweb.freebsd.org/changeset/base/331880 >>> >>> Log: >>> MFC r328331: Support configuring arbitrary limits(1) for any rc.conf >>> daemon >>> Usage is ${name}_limits, and the argument is any flags accepted by >>> limits(1), such as `-n 100' (e.g. only allow 100 open files). >>> >>> Modified: >>> stable/11/etc/rc.subr >>> Directory Properties: >>> stable/11/ (props changed) >>> >>> Modified: stable/11/etc/rc.subr >>> >>> ============================================================================== >>> --- stable/11/etc/rc.subr Mon Apr 2 15:07:41 2018 (r331879) >>> +++ stable/11/etc/rc.subr Mon Apr 2 15:28:48 2018 (r331880) >>> @@ -773,6 +773,8 @@ check_startmsgs() >>> # >>> # ${name}_login_class n Login class to use, else "daemon". >>> # >>> +# ${name}_limits n limits(1) to apply to ${command}. >>> +# >> >> >> Caution, limits(1) is in /usr/bin, this code can fail if used before >> /usr is mounted. (Ie, our rc.initdiskless) is probably broken by >> this change if a call is made to limits. >> >> > > Sorry for jumping on this so late. This is also an issue in CURRENT, and > has been since at least 2016. > > See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=206291 > I kind of like Cy's approach in Comment #7.. scripts that start pretty early, at least, are bound to trip over all kinds of issues. I don't think it's a good idea to work around this in rc.subr like his "relief valve" patch since it'll just create hidden inconsistencies in some of these things. _limits isn't getting applied, but it's not obvious that _limits isn't getting applied because we just silently work around it. Before we know it, we'll be adding something else that's nice in the general case but not applicable for some of these earlier bits. Rod, what are you thoughts on these approaches?