From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id QLZ4DqJVcWEeLwAAgWs5BA (envelope-from ) for ; Thu, 21 Oct 2021 13:57:22 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id uK0mCqJVcWFacQAAB5/wlQ (envelope-from ) for ; Thu, 21 Oct 2021 11:57:22 +0000 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 876D91241E for ; Thu, 21 Oct 2021 13:57:20 +0200 (CEST) Received: from localhost ([::1]:33472 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mdWhD-0002Dj-MC for larch@yhetil.org; Thu, 21 Oct 2021 07:57:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50906) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mdWgx-0002Da-TR for guix-patches@gnu.org; Thu, 21 Oct 2021 07:57:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:44793) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mdWgv-0000vF-Tq for guix-patches@gnu.org; Thu, 21 Oct 2021 07:57:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mdWgv-0003w8-Sy for guix-patches@gnu.org; Thu, 21 Oct 2021 07:57:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#51315] [PATCH] services: tor: Raise file descriptor ulimit. Resent-From: Tobias Geerinckx-Rice Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 21 Oct 2021 11:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 51315 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 51315@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.163481739415088 (code B ref -1); Thu, 21 Oct 2021 11:57:01 +0000 Received: (at submit) by debbugs.gnu.org; 21 Oct 2021 11:56:34 +0000 Received: from localhost ([127.0.0.1]:56339 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mdWgT-0003vI-LR for submit@debbugs.gnu.org; Thu, 21 Oct 2021 07:56:33 -0400 Received: from lists.gnu.org ([209.51.188.17]:36874) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mdWgQ-0003vA-TQ for submit@debbugs.gnu.org; Thu, 21 Oct 2021 07:56:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50810) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mdWgQ-0002DI-J9 for guix-patches@gnu.org; Thu, 21 Oct 2021 07:56:30 -0400 Received: from tobias.gr ([2a02:c205:2020:6054::1]:32806) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mdWgK-0000Qf-HQ for guix-patches@gnu.org; Thu, 21 Oct 2021 07:56:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=2018; bh=jTPw5gkr+RlWN xWWN0UcBpT6JEkHDq8b5RTBDpEBknE=; h=date:subject:to:from; d=tobias.gr; b=UQilb/PD04nCxBEJMpHK6l9fgEIoAFwtBWnRhdagaPrTjKPFXRmz5dTxbVG/R1XsKv+V UmLXPjYNohEw5zOWknv/MxY2pGKum1/Gj10uUPfjKnRxhV3W/hMH1yHJXYmYKevGJAv6dH VM8tOxBoE+T6Ppcav3+J4cXiP5mDS45kUd2ZJU2bU6I1xgBnmHWDLomP6x2VV5DeEKn9SK NEOBUGIdk97n/1ZQkNvl0rNTaSh9ZFmKROmHB+VuWvVifeLrKUHzuREyto7TGYwNeuPfmb BHmH8Ayy55gx94bOw1jYb0tDgZGK3OgtsfuEpPFhoq3+YqJKvQUXn1a7whGck1UQ== Received: by submission.tobias.gr (OpenSMTPD) with ESMTPSA id 801422dd (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO) for ; Thu, 21 Oct 2021 11:56:15 +0000 (UTC) Date: Thu, 21 Oct 2021 13:56:22 +0200 Message-Id: <20211021115622.826-1-me@tobias.gr> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a02:c205:2020:6054::1; envelope-from=me@tobias.gr; helo=tobias.gr X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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" Reply-to: Tobias Geerinckx-Rice X-ACL-Warn: , Tobias Geerinckx-Rice via Guix-patches From: Tobias Geerinckx-Rice via Guix-patches via X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1634817441; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=jTPw5gkr+RlWNxWWN0UcBpT6JEkHDq8b5RTBDpEBknE=; b=q23C73sE95BFj0LrP56FkPsojU/3H+ygyrU/nWojDKxuJrKFNGRJnChVgK3IIC+Ffs1LIw Kn5UGlIni8CohN22HZB92ojvjAhxc4ydXTRkF4DC5yj4vwZvJRfl82P6DMERQlZuQmI2JL p66PVMYPoRJPjbsOcb4f8Vd8t5vvsDcCeGni7kFc0KIwVs/cG2cRvB4+sQv8kB4elROL5r LhVKU+TqtR2OCYNLG04wPAJLZ8C1LawZFdSVIvcIm0U/p8Ws0rL1C3s8F0Ctb8886+F0zh CqM2JOLM+fyWMzi7D2Th+heG1s1R32mkbiqrane+A6HcQoPIyJnnfQKVsbF+1w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1634817441; a=rsa-sha256; cv=none; b=Wxzf+5bvFlYt3en2lecDjEuFC+Qrl7HZ0NXWX0pYA20NI+9ZNYsdPhiKMoidS0NgLSMNMa GH4D+h+BEbLZOg2YuU0EBpNc2SC/vxsdWTnmzahIta7qWlN8r9nYP32GgKNukiLz8D0Q4k mWYGnHpz3noqr3pGbWwJY4hxQJ/Y7Yxv7PKyPk0xdxGJJNI8BWQu4ENbWHwXne04ddXZjf F8HppVqMAkKeAqNeJpjVIhryfgZ22Drr/Vg9l670YXrK1MnhMtFftk+pFkKf+kW92Lej7L 0xucyL9z7aNBIBUNhgxm0UthUdVyenqFXHlUjAC2DZg77qdsmVAKwI4XxXKTMQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=tobias.gr header.s=2018 header.b="UQilb/PD"; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: 2.57 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=tobias.gr header.s=2018 header.b="UQilb/PD"; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 876D91241E X-Spam-Score: 2.57 X-Migadu-Scanner: scn0.migadu.com X-TUID: b6S9dEDG8AlG * gnu/services/tor.scm (tor-shepherd-service): Run ulimit -n before launching Tor. --- Guix, I got a kind mail from an authorised Torperson[0] that one of my nodes was running low on efdees. Sure enough, it was the Guix one. This patch does the job, but boy, would I like to know if there's a better way to do it. Kind regards, T G-R [0]: Yes, I did bite their official-looking badge to make sure it wasn't just someone trying to ingratiate themselves with incompetent relay operators. gnu/services/networking.scm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index e19add927d..13150cb98e 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -948,34 +948,40 @@ (define (tor-shepherd-service config) (($ tor) (let ((torrc (tor-configuration->torrc config))) (with-imported-modules (source-module-closure '((gnu build shepherd) (gnu system file-systems))) (list (shepherd-service (provision '(tor)) ;; Tor needs at least one network interface to be up, hence the ;; dependency on 'loopback'. (requirement '(user-processes loopback syslogd)) (modules '((gnu build shepherd) (gnu system file-systems))) + ;; The file descriptor ulimit must be raised in the + ;; environment from which the daemon is launched; see + ;; https://gitweb.torproject.org/tor.git/plain/doc/TUNING + ;; The exact number is somewhat arbitrary but taken from + ;; https://gitweb.torproject.org/debian/tor.git/tree/debian/tor.init#n40 (start #~(make-forkexec-constructor/container (list #$(file-append bash "/bin/bash") "-c" (string-append "ulimit -n 32768; exec " - #$(file-append tor "/bin/tor") " -f " #$torrc)) + #$(file-append tor "/bin/tor") + " -f " #$torrc)) #:log-file "/var/log/tor.log" #:mappings (list (file-system-mapping (source "/var/lib/tor") (target source) (writable? #t)) (file-system-mapping (source "/dev/log") ;for syslog (target source)) (file-system-mapping (source "/var/run/tor") (target source) (writable? #t))) #:pid-file "/var/run/tor/tor.pid")) (stop #~(make-kill-destructor)) -- 2.33.0