all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Maxime Devos <maximedevos@telenet.be>
To: Attila Lendvai <attila@lendvai.name>, guix-devel <guix-devel@gnu.org>
Subject: Re: setting open files limit for daemon processes
Date: Fri, 25 Feb 2022 11:42:27 +0100	[thread overview]
Message-ID: <e6b34f1cd0f872c72d77a40a56cfb86d40d9b6b2.camel@telenet.be> (raw)
In-Reply-To: <dXSFecm2IGWpqiy4dCWFZOFGxZSsKR4yIjYR0Bsu_1G5INb63P8ya0NdQgkYsDQNFP7P6-TDJn7H84-tPg9lHhIeliOX6PixknN3aCnXorQ=@lendvai.name>

[-- Attachment #1: Type: text/plain, Size: 954 bytes --]

Attila Lendvai schreef op vr 25-02-2022 om 07:55 [+0000]:
> "The per-process limit is inherited by each process from its parent",
> and Shepherd is the init process. when it spawns a daemon, it inherits
>  its open files limit.
> 
> i have successfully set the limit for the daemon user using:
> 
> (pam-limits-service
>   (list
>     (pam-limits-entry "*" 'both 'nofile 100000)))
> 
> and it is applied as observable with:
> 
> su - [daemon user] -c 'ulimit -aHS' -s `which bash`

That might set the limit of the user when that user logins (and hence,
PAM things are run), but I don't see how this changes the limit of
shepherd itself.  I don't think that shepherd interacts with PAM at
all?

My suggestion is to do (setrlimit RLIMIT_NOFILE [...]) inside shepherd
itself -- when shepherd starts, or between 'fork' and 'exec'.  Maybe
an '#:open-file-limit' argument could be added to 'fork+exec-command'?

Greetings,
Maxime

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

  reply	other threads:[~2022-02-25 10:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-25  7:55 setting open files limit for daemon processes Attila Lendvai
2022-02-25 10:42 ` Maxime Devos [this message]
2022-02-25 14:09   ` Attila Lendvai
2022-02-25 21:28     ` Attila Lendvai
2022-02-25 22:04       ` Maxime Devos

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e6b34f1cd0f872c72d77a40a56cfb86d40d9b6b2.camel@telenet.be \
    --to=maximedevos@telenet.be \
    --cc=attila@lendvai.name \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.