guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#51315] [PATCH] services: tor: Raise file descriptor ulimit.


From: Ludovic Courtès
Subject: [bug#51315] [PATCH] services: tor: Raise file descriptor ulimit.
Date: Thu, 28 Oct 2021 20:43:10 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)

Hello!

Tobias Geerinckx-Rice <me@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’.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]