GNU bug report logs - #51315
[PATCH] services: tor: Raise file descriptor ulimit.

Previous Next

Package: guix-patches;

Reported by: Tobias Geerinckx-Rice <me <at> tobias.gr>

Date: Thu, 21 Oct 2021 11:57:01 UTC

Severity: normal

Tags: patch

Full log


View this message in rfc822 format

From: Ludovic Courtès <ludo <at> gnu.org>
To: Tobias Geerinckx-Rice <me <at> tobias.gr>
Cc: 51315 <at> debbugs.gnu.org
Subject: [bug#51315] [PATCH] services: tor: Raise file descriptor ulimit.
Date: Thu, 28 Oct 2021 20:43:10 +0200
Hello!

Tobias Geerinckx-Rice <me <at> tobias.gr> skribis:

> +                ;; 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 tor "/bin/tor") "-f" #$torrc)
> +                          (list #$(file-append bash "/bin/bash") "-c"
> +                                (string-append "ulimit -n 32768; exec "
> +                                               #$(file-append tor "/bin/tor")
> +                                               " -f " #$torrc))

Instead of going through Bash, what about something like:

  (lambda _
    (let ((pid (fork+exec-command/container …)))
      (container-excursion* pid
                            (lambda () (setrlimit 'nofile 32768 32768)))
      pid))

?

Ludo’.




This bug report was last modified 3 years and 228 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.