[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
setting open files limit for daemon processes
From: |
Attila Lendvai |
Subject: |
setting open files limit for daemon processes |
Date: |
Fri, 25 Feb 2022 07:55:37 +0000 |
dear Guix'ers,
"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`
and yet, when i `herd stop` and `herd start` the process, even though it's
running with the right uid, its limit is still the default, as per:
cat /proc/[pid]/limits
the suggested solution i find online is to edit:
/etc/pam.d/common-session-noninteractive
to include:
session required pam_limits.so
but this is not how Guix arranges things.
i looked into extending my service
(https://github.com/attila-lendvai/guix-crypto/blob/main/src/guix-crypto/services/swarm.scm)
to add some pam rules, but i'd need to learn a whole lot of pam for that, and
the Guix code around service extensions is also rather complex, so i decided to
ask here:
is there an example somewhere demonstrating how to increase the open file limit
of a daemon process?
any hints/guidance is appreciated.
--
- attila
PGP: 5D5F 45C7 DFCD 0A39n
- setting open files limit for daemon processes,
Attila Lendvai <=