From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id IJNcDvSVH2LSAgAAgWs5BA (envelope-from ) for ; Wed, 02 Mar 2022 17:06:12 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id sIwDC/SVH2ImhAEAauVa8A (envelope-from ) for ; Wed, 02 Mar 2022 17:06:12 +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 AA6F0187D4 for ; Wed, 2 Mar 2022 17:06:11 +0100 (CET) Received: from localhost ([::1]:37538 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nPRUQ-00082J-BO for larch@yhetil.org; Wed, 02 Mar 2022 11:06:10 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55424) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nPRUJ-00080w-4m for guix-patches@gnu.org; Wed, 02 Mar 2022 11:06:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:46691) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nPRUI-0007xM-Sr for guix-patches@gnu.org; Wed, 02 Mar 2022 11:06:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nPRUI-0006tb-FO for guix-patches@gnu.org; Wed, 02 Mar 2022 11:06:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#54205] [PATCH Shepherd] Factor out a public CALL-IN-FORK. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 02 Mar 2022 16:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54205 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxime Devos Cc: 54205@debbugs.gnu.org, Attila Lendvai Received: via spool by 54205-submit@debbugs.gnu.org id=B54205.164623713726474 (code B ref 54205); Wed, 02 Mar 2022 16:06:02 +0000 Received: (at 54205) by debbugs.gnu.org; 2 Mar 2022 16:05:37 +0000 Received: from localhost ([127.0.0.1]:40588 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nPRTt-0006sw-1l for submit@debbugs.gnu.org; Wed, 02 Mar 2022 11:05:37 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:36716) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nPRTr-0006si-1s for 54205@debbugs.gnu.org; Wed, 02 Mar 2022 11:05:35 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 762E9801; Wed, 2 Mar 2022 17:05:28 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mxuPtlAx83p7; Wed, 2 Mar 2022 17:05:27 +0100 (CET) Received: from ribbon (91-160-117-201.subs.proxad.net [91.160.117.201]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 1A8E1D2; Wed, 2 Mar 2022 17:05:27 +0100 (CET) From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20220301070615.21028-1-attila@lendvai.name> Date: Wed, 02 Mar 2022 17:05:26 +0100 In-Reply-To: (Maxime Devos's message of "Tue, 01 Mar 2022 13:47:09 +0100") Message-ID: <87lexs1gs9.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: / X-Rspamd-Server: hera X-Rspamd-Queue-Id: 762E9801 X-Spamd-Result: default: False [-0.10 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] 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" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1646237172; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: 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=1ioxTwC3fuHTiSXoXCLQ8ejXxkEARy3S3arcVtsamy8=; b=t610S8rOmCObc+JsXwiBubR9RlqQs8SPUB2Agb6x3yzr0kZs6Lu0EPt0m60hGA64ct7H22 2PjwlDs2Apa99C/0MTacAKnwdSFQjuFt7iK27kCJP7fBOvLunFZKd1B7Cze+jRkv+3p5fO vpiI+qcJ2rmEB/PqPVkL5qrxqcg/dr/PzVE4S2ifZe2TiV0UQOo9F+QA3iMB23AzNaR/4R did+le2jNvfUMFUx0ev+3mk0q3l4gL7NH4ghmMNd2b4Hp0x118n8L15FzzNpnbqNH+vUlC LkbzB8aj5jgMYOSJyjAC5KVvBlrR1lVxWRq2G/j4jK0UlwQoyQfSgDqxAgkqNQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1646237172; a=rsa-sha256; cv=none; b=mFbhTHTi+Ubo5c3DOmagkj1xfta+rV0MFCE8m8kHWjhgVCHtyv62wiH4wnZ7BlLyT8gUMx qGgGDN91GjP2h87ShPprG0F6+CpgSI9Yfw4bjicPXulaUACQvx/D1Zim7n9dc/BKAhkDzI tzI7FwRVQzhAm8P7e9akoVvP4PG8WnTLvS0zJ/ECetBSABNB2YsJRgUrSiva/UCHzsP28a PJiaEsjW1t8/OjvLVqIxXXErEYlLAwExHKYbDu2jlBFKBVkbDgP4lzdy5XWw0/QlG9ok7f IVM6I1fVtpcSpMyWRwsnUgv/ynKpEWBGhwfGSm7uUkb1Jyo34zThgULmPk2LFw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; 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" X-Migadu-Spam-Score: -5.28 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; 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" X-Migadu-Queue-Id: AA6F0187D4 X-Spam-Score: -5.28 X-Migadu-Scanner: scn0.migadu.com X-TUID: fwSlJ/A6uNdc Hi, Maxime Devos skribis: > Attila Lendvai schreef op di 01-03-2022 om 08:06 [+0100]: >> their service is started.=C2=A0 One such example is calling setrlimit fr= om a start >> action to set NOFILE (the open files limit), before the service is exec'= ed and >> thus inherits this value from the parent process, i.e. from Shepherd. > > 'fork+exec-command' already accepts a 'environment-variables' and > 'file-creation-mask', how about adding an 'open-file-limit' argument? > To me, that seems more declarative and less fragile than having > to call 'call-in-fork' manually in a 'start' procedure (*). Seconded. > Support for other rlimits can be added on an as-needed basis. > Alternatively, the argument could be generalised to a more general > 'rlimit' argument: > > #:rlimits > `((,RLIMIT_AS ,SOFT ,HARD) > (,RLIMIT_NPROC ,SOFT ,HARD) > (,RLIMIT_NOFILE ,SOFT ,HARD)) > > WDYT? This interface brings more flexibility, I=E2=80=99m all for it. > (*) E.g., one of the ideas for making shepherd faster, was using some > kind of multi-threading. Forking when multi-threading is ill-defined I think what we need is concurrency, not POSIX threads. IOW, we can achieve the concurrency we need without resorting to POSIX threads, for example using Fibers on a single POSIX thread. Thanks, Ludo=E2=80=99.