From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id AM4eGJa1A2S15wAAbAwnHQ (envelope-from ) for ; Sat, 04 Mar 2023 22:18:14 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id SME5F5a1A2TNxwAAG6o9tA (envelope-from ) for ; Sat, 04 Mar 2023 22:18:14 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id D86B21EF1 for ; Sat, 4 Mar 2023 22:18:13 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pYZGW-0005SQ-Qp; Sat, 04 Mar 2023 16:18:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pYZGV-0005S5-An for guix-patches@gnu.org; Sat, 04 Mar 2023 16:18:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pYZGU-00030X-SN for guix-patches@gnu.org; Sat, 04 Mar 2023 16:18:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pYZGU-00058x-AB for guix-patches@gnu.org; Sat, 04 Mar 2023 16:18:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#61744] [PATCH v2 1/2] services: base: Deprecate 'pam-limits-service' procedure. References: In-Reply-To: Resent-From: Bruno Victal Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 04 Mar 2023 21:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61744 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 61744@debbugs.gnu.org Cc: Bruno Victal Received: via spool by 61744-submit@debbugs.gnu.org id=B61744.167796466919743 (code B ref 61744); Sat, 04 Mar 2023 21:18:02 +0000 Received: (at 61744) by debbugs.gnu.org; 4 Mar 2023 21:17:49 +0000 Received: from localhost ([127.0.0.1]:37899 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pYZGG-00058H-RD for submit@debbugs.gnu.org; Sat, 04 Mar 2023 16:17:49 -0500 Received: from smtpm3.myservices.hosting ([185.26.105.234]:44412) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pYZGF-000588-2d for 61744@debbugs.gnu.org; Sat, 04 Mar 2023 16:17:48 -0500 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpm3.myservices.hosting (Postfix) with ESMTP id 399D0210B0 for <61744@debbugs.gnu.org>; Sat, 4 Mar 2023 22:17:43 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id DBA6880098; Sat, 4 Mar 2023 22:17:43 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-2.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id oGUTyUaMW9cr; Sat, 4 Mar 2023 22:17:43 +0100 (CET) Received: from guix-nuc.home.arpa (bl9-119-177.dsl.telepac.pt [85.242.119.177]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id 1BC3980079; Sat, 4 Mar 2023 22:17:43 +0100 (CET) From: Bruno Victal Date: Sat, 4 Mar 2023 21:17:38 +0000 Message-Id: <47849c839cb8acb6909eccd1f050b0316373b377.1677964609.git.mirai@makinata.eu> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1677964694; a=rsa-sha256; cv=none; b=dPg35M2gZAbi0mPfefT0Bi2foXbFi4uqYdTd8BCBLTPOHCnJh0errv+j9mbvrv97nKbDHr OwQ/ZpePm3+c9jrCrrf6zXevtBrqls10Je/YBwMRCezLgs0B5m9ViD2xdjuWqNrFv2h6+O 4VvlyI2wFE+rB9+BoL7X14frgcTQtCBKgT+PUTOFFNH10MC0o70EhkKBdgUbKocdQ2Cf+O d/oifVpiSo+dom6ru9QQvJRgC8JoAwECmWJiAGXMq/SIVs1bdoXUMy0R1RvGLKNke3q0ou oBCCT5tifOCPjPg5jZ0aSRHYGi2RN2qd4u81428HW0E9gBYBTpFnQNvSTP0c9g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1677964694; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=xHnCrfY49x1Q9a4a1qMrMAeSXs+nB2DQ+s/SBSYafIc=; b=jlwUecgXOCyVo6OUCZBM+fRuMg0c1bIbBovFxMHBa6SGolcZHRovv3mGLaEfG1ACohfTwc f1EXwbz+oIwUoqhHTRuzMf4BzO04rJKlhpmM48jcPt8PWG9DT2uf4N/5r0zRPDD4x+KcsN RRA8todonjt4JoXoHd4S0+i1JE96LUaOFf8KkSl09RJL1NEPIMUOcCe0a7R8umHJeYbpnp s1qimURHQfcxqUS7BzcZsdosTP6IzM/mX7FeM2wWA1lTxCSntUMwaoLf/U95FjxsEfGmqK /XPwxUy7kN4NfYr32brdZH4sZhEiKff51RAoPvn6Kaac5ZkihrE5NAfalc7Tww== X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: -1.70 X-Spam-Score: -1.70 X-Migadu-Queue-Id: D86B21EF1 Authentication-Results: aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=none X-TUID: /LInRH8NQEHo * doc/guix.texi (Base Services): Replace pam-limits-service with pam-limits-service-type. * gnu/packages/benchmark.scm (python-locust)[description]: Update index anchor to manual. * gnu/services/base.scm (pam-limits-service-type): Set default value. (pam-limits-service): Deprecate procedure. --- doc/guix.texi | 37 ++++++++++++++++++++++--------------- gnu/packages/benchmark.scm | 2 +- gnu/services/base.scm | 8 +++++--- 3 files changed, 28 insertions(+), 19 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 74658dbc86..3aa9c0cdf4 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -18938,7 +18938,6 @@ Base Services @end table @end deftp -@anchor{pam-limits-service} @cindex session limits @cindex ulimit @cindex priority @@ -18946,22 +18945,28 @@ Base Services @cindex jackd @cindex nofile @cindex open file descriptors -@deffn {Scheme Procedure} pam-limits-service [#:limits @code{'()}] - -Return a service that installs a configuration file for the +@anchor{pam-limits-service-type} +@defvar pam-limits-service-type +Type of the service that installs a configuration file for the @uref{http://linux-pam.org/Linux-PAM-html/sag-pam_limits.html, -@code{pam_limits} module}. The procedure optionally takes a list of -@code{pam-limits-entry} values, which can be used to specify -@code{ulimit} limits and @code{nice} priority limits to user sessions. +@code{pam_limits} module}. The value for this service type is +a file-like object containing a list of @code{pam-limits-entry} values +which can be used to specify @code{ulimit} limits and @code{nice} +priority limits to user sessions. The following limits definition sets two hard and soft limits for all login sessions of users in the @code{realtime} group: @lisp -(pam-limits-service - (list - (pam-limits-entry "@@realtime" 'both 'rtprio 99) - (pam-limits-entry "@@realtime" 'both 'memlock 'unlimited))) +(service + pam-limits-service-type + (plain-file + "limits.conf" + (string-join + (map pam-limits-entry->string + (list (pam-limits-entry "@@realtime" 'both 'rtprio 99) + (pam-limits-entry "@@realtime" 'both 'memlock 'unlimited))) + "\n"))) @end lisp The first entry increases the maximum realtime priority for @@ -18973,9 +18978,11 @@ Base Services descriptors that can be used: @lisp -(pam-limits-service - (list - (pam-limits-entry "*" 'both 'nofile 100000))) +(service + pam-limits-service-type + (plain-file + "limits.conf" + (pam-limits-entry->string (pam-limits-entry "*" 'both 'nofile 100000)))) @end lisp In the above example, the asterisk means the limit should apply to any @@ -18984,7 +18991,7 @@ Base Services else the users would be prevented from login in. For more information about the Pluggable Authentication Module (PAM) limits, refer to the @samp{pam_limits} man page from the @code{linux-pam} package. -@end deffn +@end defvar @defvar greetd-service-type @uref{https://git.sr.ht/~kennylevinsen/greetd, @code{greetd}} is a minimal and diff --git a/gnu/packages/benchmark.scm b/gnu/packages/benchmark.scm index 33e2466da9..fd8513f41d 100644 --- a/gnu/packages/benchmark.scm +++ b/gnu/packages/benchmark.scm @@ -458,7 +458,7 @@ (define-public python-locust Note: Locust will complain if the available open file descriptors limit for the user is too low. To raise such limit on a Guix System, refer to -@samp{info guix --index-search=pam-limits-service}.") +@samp{info guix --index-search=pam-limits-service-type}.") (license license:expat))) (define-public interbench diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 1423ab6767..e5023b8175 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -246,7 +246,7 @@ (define-module (gnu services base) kmscon-service-type pam-limits-service-type - pam-limits-service + pam-limits-service ; deprecated greetd-service-type greetd-configuration @@ -1612,9 +1612,11 @@ (define pam-limits-service-type (description "Install the specified resource usage limits by populating @file{/etc/security/limits.conf} and using the @code{pam_limits} -authentication module.")))) +authentication module.") + (default-value (plain-file "limits.conf" ""))))) -(define* (pam-limits-service #:optional (limits '())) +(define-deprecated (pam-limits-service #:optional (limits '())) + pam-limits-service-type "Return a service that makes selected programs respect the list of pam-limits-entry specified in LIMITS via pam_limits.so." (service pam-limits-service-type -- 2.39.1