[systemd-devel] systemd user instance and raising limits

Lennart Poettering lennart at poettering.net
Mon Nov 20 12:10:27 UTC 2017


On So, 19.11.17 16:57, Jeff Solomon (jsolomon8080 at gmail.com) wrote:

> > I didn't think that systemd paid one bit of attention to the settings
> >> controlled by pam_limits?
> >>
> >
> > The user@ instance runs user-controlled processes, much like cron would,
> > so its service unit has PAM enabled as well.
> >
> 
> When I change pam_limits for a user via a file /etc/security/limits.d/, and
> then restart the user instance, neither the user instance itself nor the
> children of that instance are affected by those settings. OTOH, when I
> login again as that user, that login session does have those custom limits
> set.
> 
> Based on your previous comment, I would have expected the user instance and
> its child to show those custom limits. What did am I getting wrong?

Note that user at .service is only restarted if you fully log out
(i.e. all your sessions) and then login back again. And only when it
is restarted the new limits will be applied to systemd --user.

if you use lingering, then not even this will work, since after all
you declare that way that for your user the user at .service instance
shall stick around for system boot-up till shutdown. In that case,
please just explicitly issue "systemctl restart user@….service" as
root, so that the service is restarted.

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list