[systemd-devel] systemd user instance and raising limits

Lennart Poettering lennart at poettering.net
Mon Nov 20 16:47:33 UTC 2017


On Mo, 20.11.17 08:32, Jeff Solomon (jsolomon8080 at gmail.com) wrote:

> I am using lingering and I have issued "systemctl restart user@<uid>" and
> then seen the instance restart with a new PID. So I think I am restarting
> the user instance.
> 
> When Limit* directives are applied in "user at .service" or in
> "/etc/systemd/system/user at .service.d/whatever.conf" I see that they are
> respected in the user instance itself and the child processes it starts.
> 
> However, I do NOT see settings applied through pam_limits
> (/etc/security/limits.d etc etc) respected in the user instance although
> Mantas implied that I should. Is this expected?

When systemd executes a service that has PAM enabled, it will will
first start the PAM session, which is where pam_limits does its
thing. It then goes on setting up the execution environment for the
service, and if resource limits are configured for the unit, they'll
be put into effect. This means that any settings configured in the
unit file they take precedence over the pam_limits settings.

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list