From owner-svn-src-all@freebsd.org Sun Jun 19 03:32:28 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 9DED2A7A319; Sun, 19 Jun 2016 03:32:28 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-io0-x22e.google.com (mail-io0-x22e.google.com [IPv6:2607:f8b0:4001:c06::22e]) (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 630522B48; Sun, 19 Jun 2016 03:32:28 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-io0-x22e.google.com with SMTP id f30so98107825ioj.2; Sat, 18 Jun 2016 20:32:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=P1JsJPb3unPZtLMZIZSL20vvHQcYN9ktddSV4IIQ05M=; b=E/le8PaySYylMSmzkaX+GF4UjWsi3Mpn3HwtAhzrqsRAFRiN+A6W8TWzGlWkBjjN3y 2vQahlO+RHOrRiALcX8LlnwA/DNJryqMO1p3oV4EjJzTJUJbZ93AmBQ9jEtdcUP8xbse f8SnLP9/8Uk+bGpY6YUL2n6wbpc5A4rPqsYaOcQuZuvaVHZYbr2QoDLHuQR8Z5cDMmIz tk2wUGH4ylmEPPJq3VM57+dF2v2NSNtHpcUSuW8ZThQ9t3xDs3HDjVYhhcRTC+yAUfol 45c5bgkbOCZleCaHRACH5WeXvFdmg2PKVmlphWONdp09u01bSsNW7OarHgqeowS07Q6F bbMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=P1JsJPb3unPZtLMZIZSL20vvHQcYN9ktddSV4IIQ05M=; b=BodpDUsQ+PDH3OmGs4SC9yOVapsmu5ESNuCsUmh1LOo3iqoS37FDUUiMauK2wpWvUb mD+lStfAEF+QfCSJ9vAcbzdjCFwILAKrrfq0e0OgR8tJC/cNWrVzQWIQWUkJfX0baH9Z OhzRszW9T5bUgBmCDS270MACZEXJbd9kc1WpTayhsveiSqvkIekqeSXBT/6diymtcsJ2 /XCLApqdWXr6cue59xg9wliaOdRirXKntWNxBY1C2Bjz4ONGUU8s53RXfrc1IVDFRaiZ wtGSizyleFKDW6SCcsuA3ss8OgC0nR4wyk1ar6D7BNrvqauNVEDr+qU7aULnuwpMsby9 N6QQ== X-Gm-Message-State: ALyK8tKW9KdIhbASJfRbP3NpnuHZ4iAS85ETUicQlpNmF3OLQycb8fkeIteHGBd9oeQoZ4uLFpr5C+PHzWmbng== X-Received: by 10.107.144.2 with SMTP id s2mr12322349iod.165.1466307147600; Sat, 18 Jun 2016 20:32:27 -0700 (PDT) MIME-Version: 1.0 Sender: adrian.chadd@gmail.com Received: by 10.36.113.3 with HTTP; Sat, 18 Jun 2016 20:32:26 -0700 (PDT) In-Reply-To: <201606190006.u5J06Qk6009591@slippy.cwsent.com> References: <2171b966-35c7-2dad-2c0f-f23061cb677a@freebsd.org> <201606190006.u5J06Qk6009591@slippy.cwsent.com> From: Adrian Chadd Date: Sat, 18 Jun 2016 20:32:26 -0700 X-Google-Sender-Auth: pGY9XasTuOiq20l4LYAMBYCbDds Message-ID: Subject: Re: svn commit: r288291 - head/etc To: Cy Schubert Cc: Niclas Zeising , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 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: Sun, 19 Jun 2016 03:32:28 -0000 i think that's fine for -11. I'd like to just move limits to /bin for 12. (I mean, it's 2016, why are you splitting / and /usr again? But..) I don't want to see differing system behaviour between limits but it's likely unavoidable for 11 and could do with some errata notice so people know what to expect. Thanks, -adrian On 18 June 2016 at 17:06, Cy Schubert wrote: > In message <2171b966-35c7-2dad-2c0f-f23061cb677a@freebsd.org>, Niclas > Zeising w > rites: >> On 09/27/15 06:03, Adrian Chadd wrote: >> > Author: adrian >> > Date: Sun Sep 27 04:03:11 2015 >> > New Revision: 288291 >> > URL: https://svnweb.freebsd.org/changeset/base/288291 >> > >> > Log: >> > Enforce consistent limits of daemons run from rc.subr: >> > >> > * Allow the user to configure the login class to use in rc.conf >> > by using {daemon}_login_class, which; >> > * Use the daemon class by default; >> > * .. and then use 'limits' to set the login class so it works both >> > via init at startup (which runs this in 'daemon' class) and via >> > whichever root environment (eg command line, other daemons, etc.) >> > >> > Reviewed by: dteske >> > Differential Revision: https://reviews.freebsd.org/D3630 >> > >> > Modified: >> > head/etc/rc.subr >> > >> > Modified: head/etc/rc.subr >> > =========================================================================== >> === >> > --- head/etc/rc.subr Sun Sep 27 03:46:55 2015 (r288290) >> > +++ head/etc/rc.subr Sun Sep 27 04:03:11 2015 (r288291) >> > @@ -768,6 +768,8 @@ check_startmsgs() >> > # >> > # ${name}_prepend n Command added before ${command}. >> > # >> > +# ${name}_login_class n Login class to use, else "daemon". >> > +# >> > # ${rc_arg}_cmd n If set, use this as the method when invoked; >> > # Otherwise, use default command (see below) >> > # >> > @@ -942,7 +944,7 @@ run_rc_command() >> > _nice=\$${name}_nice _user=\$${name}_user \ >> > _group=\$${name}_group _groups=\$${name}_groups \ >> > _fib=\$${name}_fib _env=\$${name}_env \ >> > - _prepend=\$${name}_prepend >> > + _prepend=\$${name}_prepend _login_class=\${${name}_login_class:-da >> emon} >> > >> > if [ -n "$_user" ]; then # unset $_user if running as that user >> > if [ "$_user" = "$(eval $IDCMD)" ]; then >> > @@ -1050,6 +1052,9 @@ $command $rc_flags $command_args" >> > fi >> > fi >> > >> > + # Prepend default limits >> > + _doit="limits -C $_login_class $_doit" >> ^^^^^^^^^^ >> > + >> > # run the full command >> > # >> > if ! _run_rc_doit "$_doit"; then >> >> Apologies for waking so late. >> This breaks the start of scripts running before file systems are >> mounted, for example /etc/rc.d/ddb, if / and /usr are on separate >> partitions. The issue is that limits is /usr/bin/limits, and for >> obvious reasons can't be found before /usr is mounted. >> I suggest either move /usr/bin/limits to /bin/limits or avoid using it >> altogether. >> Do you want me to open a PR to track this issue? >> Regards! > > A simple solution might be, > > Index: rc.subr > =================================================================== > --- rc.subr (revision 302001) > +++ rc.subr (working copy) > @@ -1071,8 +1071,13 @@ > fi > fi > > + # Before we prepend limits, test if limits is > + # available (/usr is mounted) so that limits can > + # be run. > + if limits >/dev/null 2>&1; then > # Prepend default limits > - _doit="limits -C $_login_class $_doit" > + _doit="limits -C $_login_class $_doit" > + fi > > # run the full command > # > > > -- > Cheers, > Cy Schubert > FreeBSD UNIX: Web: http://www.FreeBSD.org > > The need of the many outweighs the greed of the few. > > >