From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 01 07:47:18 2022 Received: (at 54205) by debbugs.gnu.org; 1 Mar 2022 12:47:18 +0000 Received: from localhost ([127.0.0.1]:35796 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nP1uQ-0001DB-4n for submit@debbugs.gnu.org; Tue, 01 Mar 2022 07:47:18 -0500 Received: from laurent.telenet-ops.be ([195.130.137.89]:48762) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nP1uN-0001Cy-PL for 54205@debbugs.gnu.org; Tue, 01 Mar 2022 07:47:16 -0500 Received: from ptr-bvsjgyhxw7psv60dyze.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by laurent.telenet-ops.be with bizsmtp id 10nE270044UW6Th010nEQK; Tue, 01 Mar 2022 13:47:14 +0100 Message-ID: Subject: Re: [bug#54205] [PATCH Shepherd] Factor out a public CALL-IN-FORK. From: Maxime Devos To: Attila Lendvai , 54205@debbugs.gnu.org Date: Tue, 01 Mar 2022 13:47:09 +0100 In-Reply-To: <20220301070615.21028-1-attila@lendvai.name> References: <20220301070615.21028-1-attila@lendvai.name> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-Ee8t70XAX0uk4RrkMNAx" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1646138834; bh=HoV6AKKiFl6eZj2+BkWLR6yM5XIFmj7zJBr1cGvoGXQ=; h=Subject:From:To:Date:In-Reply-To:References; b=GK8ygVPpMNWlGhsUdPGc3My/qzsYTEjHreTnzylyBbo4hGr++PBfvbY4PSbXcF5m2 /vQXyIX7TJoplxRJn3AxsCRgdQP59PyZlz84hb9ddkCENxDcPI07NO9/7OaSY9jy/7 BhSD+d9YvNgK50C6TB0apkV9NW730FO/RqUuKme7CsseMwrW7HZfUwpRMi41norurA Xq+sk7EFdjJjwX0TcqSRDGxr7/SBML3RNJygdrvxOBRbhPdaEUeLrRGkARVpF0E33r CsTmnLWIWckMZzMxBRuwziqtI0DBFeqlQTdIIyS1wT8gLO3CDh5xcf+XKmEQber/6n xwH6M5WFlRCVQ== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 54205 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-Ee8t70XAX0uk4RrkMNAx Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attila Lendvai schreef op di 01-03-2022 om 08:06 [+0100]: > their service is started.=C2=A0 One such example is calling setrlimit fro= m a start > action to set NOFILE (the open files limit), before the service is exec'e= d 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 (*). 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? Greetings, Maxime. (*) E.g., one of the ideas for making shepherd faster, was using some kind of multi-threading. Forking when multi-threading is ill-defined (see POSIX) though, so some kind of zygote process + IPC might be necessary (http://neugierig.org/software/chromium/notes/2011/08/zygote.html has a nice explanation on zygote processes, the bits about software updates can be ignored here). --=-Ee8t70XAX0uk4RrkMNAx Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYh4VzRccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7k8SAP4gZaaQE/hNFfzGvxdqI+eKxCqc jXMNaJTOYqkDqloFzwEAo7Eqqzbabm3nzRrq7tfYfRuU63LWiq+0/EBDo5rP4wM= =jRlT -----END PGP SIGNATURE----- --=-Ee8t70XAX0uk4RrkMNAx--