From nobody Fri Jul 22 00:27:46 2022 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Lpqyp6Cskz4Wj0v; Fri, 22 Jul 2022 00:27:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Lpqyp5Xltz3F5r; Fri, 22 Jul 2022 00:27:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658449666; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Fhbbm4QwDTZZ/TZdWgVeqm91G3oB/qBjzgmtkmMdd7U=; b=fV3QC+dTsO4GkySlv2AD/YOio4ojVdpK8RPoeHc7QIRSPxuC/rpSpxLQUSKAx7argkXdDY Hlr12QIeoPN6MZ1mCmTOzMrMjjywLJ4JKtlLIhiX1DlyMw0+Oxqhw365XAnlwefFnnRltD TD6KfY8wB7Lk7Tzpeb8fxnObyJAmrnlbHvvvLAbc7A1gXJPptRhYfixa0IpUx0t7P3NoQu u+0IKOaaGMpuQHwXlcpqaexgE6Gds28JGDCFdW/5WSe6A4TtL1Etb4JUY2GVEElfTh7a+J 58sYKeBMQwRoHjtyljE+8rGqOdB+OUCAnJ8J6IFwKVBNhNwy61DEhwiW9P5ujw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Lpqyp4bJZzhHj; Fri, 22 Jul 2022 00:27:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 26M0RkQj076338; Fri, 22 Jul 2022 00:27:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26M0RkV9076337; Fri, 22 Jul 2022 00:27:46 GMT (envelope-from git) Date: Fri, 22 Jul 2022 00:27:46 GMT Message-Id: <202207220027.26M0RkV9076337@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 5758cfbb2228 - stable/13 - rc.conf(5): Add _limits, _login_class, and _oomprotect List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5758cfbb2228f75dcff39caf8f1637662f07c65b Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658449666; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Fhbbm4QwDTZZ/TZdWgVeqm91G3oB/qBjzgmtkmMdd7U=; b=gBXMviRzuOHF0IaARkmhfwLOMNEKUfEGHLVWy2kp6NqDDoZguajMSUrGnneT4ZAFGM3baJ gTDxyu9yZwDbfZFY0Xf1Hbi6xUYXhkEfJozOxvp4cBAID4dx/GDa5OgEWbqSW5aaEPyycW 0A3Mkd+zw9B7Jubo523cCkiKeEWzYxxYHVA+khk5WwqwYZexsVvXVxWDcUB/Lj7G4x1aFQ PFFL3ht29riR9J7qzMwsLxCyxWUc4bcXZ8BQwhw2dUAIS5ldlaVIaqxbxMTGsTX9WSMzkb bQmApE/Nvigk1Jb0xY3cDVS63ATF/o5oR8J2PYlHZrJI4hmopiTS/hp95w5nXg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1658449666; a=rsa-sha256; cv=none; b=uM96nZN2/YrUCShv+Tqvj16bXCidJFi3xhu0dBr/CkqLLcfPqtxjSMISNuYZNiubnDGFhk g5qnBGLDRnT39WS9oc+GHH/0GYiZIorffPRpEzwF8tzLzbFzBubXTAEoyXnoWiPWjC1UKu Eb5Wp5vcMwZET/5fIUW7J+NrkWHTGWbSp1W8xRfN2hEjSQ7kaAuOR12FPfQm0xnhCZizFl nitDv8sTGvLgysSFT2eU6sOlLDm1c7InklUhp9mwU2fb6YwFIDd8s3TdLjrb3oIY0jFU1C gLRKS1Lyp1PlnfTIrWkanpks+shbD10yspgom5rTcnUn6VO3YkLPZHwY0wu9kA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=5758cfbb2228f75dcff39caf8f1637662f07c65b commit 5758cfbb2228f75dcff39caf8f1637662f07c65b Author: Daniel Ebdrup Jensen AuthorDate: 2021-05-18 12:46:41 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2022-07-22 00:20:42 +0000 rc.conf(5): Add _limits, _login_class, and _oomprotect Add a few very useful variables that might easily be overlooked, since they're only documented in rc.subr(8) which might not be the first place that people look. At least _oomprotect has existed since 11.0-RELEASE, and doesn't appear to be very well-known. While the others aren't as new, in my estimation, a lot more people would use them if they knew about them. While here, also add a reference to rc.subr(8) and login.conf(5), and sort the variables alphabetically. Reported by: Daniel Dettlaff Reviewed by: ceri, gbe, 0mp, ygy, a.wolk, pauamma (cherry picked from commit bd6dce978c1a4d4472c98ff5685de3c2f2bd0203) --- share/man/man5/rc.conf.5 | 49 ++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 41 insertions(+), 8 deletions(-) diff --git a/share/man/man5/rc.conf.5 b/share/man/man5/rc.conf.5 index cf07b65ee3f4..df772d567134 100644 --- a/share/man/man5/rc.conf.5 +++ b/share/man/man5/rc.conf.5 @@ -192,24 +192,53 @@ services are enabled that utilize the force_depend check. .Pq Vt str .Xr chroot 8 to this directory before running the service. -.It Ao Ar name Ac Ns Va _user -.Pq Vt str -Run the service under this user account. -.It Ao Ar name Ac Ns Va _group -.Pq Vt str -Run the chrooted service under this system group. -Unlike the _user -setting, this setting has no effect if the service is not chrooted. .It Ao Ar name Ac Ns Va _fib .Pq Vt int The .Xr setfib 1 value to run the service under. +.It Ao Ar name Ac Ns Va _group +.Pq Vt str +Run the chrooted service under this system group. +Unlike the +.Ao Ar name Ac Ns Va _user +setting, this setting has no effect if the service is not chrooted. +.It Ao Ar name Ac Ns Va _limits +.Pq Vt str +Resource limits to apply to the service using +.Xr limits 1 . +By default, resource limits are based on the login class defined in +.Ao Ar name Ac Ns Va _login_class . +.It Ao Ar name Ac Ns Va _login_class +.Pq Vt str +Login class to be used with +.Ao Ar name Ac Ns Va _limits . +Defaults to +.Dq Li daemon . .It Ao Ar name Ac Ns Va _nice .Pq Vt int The .Xr nice 1 value to run the service under. +.It Ao Ar name Ac Ns Va _oomprotect +Use +.Xr protect 1 +to prevent the service from being killed when swap space +is exhausted. +Use +.Dq Li YES +to protect only the service itself, and +.Dq Li ALL +to protect the service and all child processes. +.Pp +Please note rc scripts that redefine +.Bd +${name}_cmd +.Ed +such as PostgreSQL will not a inherit the OOM killer protection. +.It Ao Ar name Ac Ns Va _user +.Pq Vt str +Run the service under this user account. .It Va apm_enable .Pq Vt bool If set to @@ -4682,6 +4711,8 @@ The default is 10. .Xr gdb 1 , .Xr info 1 , .Xr kbdcontrol 1 , +.Xr limits 1 , +.Xr protect 1 , .Xr sh 1 , .Xr vi 1 , .Xr vidcontrol 1 , @@ -4703,6 +4734,7 @@ The default is 10. .Xr ipnat 5 , .Xr jail.conf 5 , .Xr loader.conf 5 , +.Xr login.conf 5 , .Xr motd 5 , .Xr newsyslog.conf 5 , .Xr pf.conf 5 , @@ -4748,6 +4780,7 @@ The default is 10. .Xr quotaon 8 , .Xr rc 8 , .Xr rc.sendmail 8 , +.Xr rc.subr 8 , .Xr rfcomm_pppd 8 , .Xr route 8 , .Xr routed 8 ,