To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact firstname.lastname@example.org
09-18-2010, 05:01 AM
Setting max open files inside a chroot
Alok G. Singh wrote:
> I have setup the limits in the host (the chroot being the guest) via
> /etc/security/limits.conf and that works just fine:
> $ ulimit -n
It works because you logged in which uses PAM and libpam set the
limits that you configured in the PAM configuration.
> However, inside the chroot it is still the old value
> $ sudo chroot /opt/id/epsilon/
> # ulimit -n
> I have this in the /etc/security/limits.conf in the chroot too but it
> seems to have no effect.
Right. You are setting PAM configuration. But chroot doesn't use PAM
and so it has no effect. Using 'chroot' then PAM is not involved at
all and therefore PAM configuration has no effect.
Since you did not provide a command it invoked your $SHELL inside the
chroot. But inside the chroot you can invoke a command that uses
pam. If you launch 'su' then su will use PAM and set up your PAM
$ sudo chroot /opt/id/epsilon su
That invokes su inside the chroot. Since su uses PAM then the PAM
configuration should have effect. But I didn't test it. :-)