<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Feb 28, 2018 at 3:30 AM, Firxiao zhang <span dir="ltr"><<a href="mailto:firxiaowork@gmail.com" target="_blank">firxiaowork@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi All.<div> I am confusing the relationship between "systemd" and "/etc/security/limits.conf". </div><div>so far, I am migrating a service(init.d) script(centos6) to systemd unit(centos7). </div><div>on centos6, I defined the user limits in "/etc/security/limits.conf". and it worked well.</div><div>after I done the same thing on centos7. I found the limits was not taking effect. so I googled this problem. it said I need define the limits in systemd unit file. like: LimitNOFILE=xxx.</div><div>Here are my questions:<br></div><div>1. are the systemd limits and the system security limits individual?</div></div></blockquote><div><br></div><div>They are completely separate. /etc/security/limits.conf is *only* read by PAM (pam_limits.so), which basically means user login sessions (getty, ssh, xdm...)</div><div><br></div><div>(Although it's possible for systemd to call PAM when starting a service, it needs careful configuration and you shouldn't do it by default.)</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>2. if not. is there a way to make systemd read the system security limits as default?</div></div></blockquote><div><br></div><div>No. Limits for a service should be in its .service file.</div></div><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Mantas Mikulėnas</div></div>
</div></div>