<div dir="ltr"><div><div>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.<br><br></div>When Limit* directives are applied in "user@.service" or in "/etc/systemd/system/user@.<wbr>service.d/whatever.conf" I see that they are respected in the user instance itself and the child processes it starts.<br><br></div>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?<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 20, 2017 at 4:10 AM, Lennart Poettering <span dir="ltr"><<a href="mailto:lennart@poettering.net" target="_blank">lennart@poettering.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On So, 19.11.17 16:57, Jeff Solomon (<a href="mailto:jsolomon8080@gmail.com">jsolomon8080@gmail.com</a>) wrote:<br>
<br>
> > I didn't think that systemd paid one bit of attention to the settings<br>
> >> controlled by pam_limits?<br>
> >><br>
> ><br>
> > The user@ instance runs user-controlled processes, much like cron would,<br>
> > so its service unit has PAM enabled as well.<br>
> ><br>
><br>
> When I change pam_limits for a user via a file /etc/security/limits.d/, and<br>
> then restart the user instance, neither the user instance itself nor the<br>
> children of that instance are affected by those settings. OTOH, when I<br>
> login again as that user, that login session does have those custom limits<br>
> set.<br>
><br>
> Based on your previous comment, I would have expected the user instance and<br>
> its child to show those custom limits. What did am I getting wrong?<br>
<br>
</div></div>Note that user@.service is only restarted if you fully log out<br>
(i.e. all your sessions) and then login back again. And only when it<br>
is restarted the new limits will be applied to systemd --user.<br>
<br>
if you use lingering, then not even this will work, since after all<br>
you declare that way that for your user the user@.service instance<br>
shall stick around for system boot-up till shutdown. In that case,<br>
please just explicitly issue "systemctl restart user@….service" as<br>
root, so that the service is restarted.<br>
<span class="HOEnZb"><font color="#888888"><br>
Lennart<br>
<br>
--<br>
Lennart Poettering, Red Hat<br>
</font></span></blockquote></div><br></div>