05-09-2016
23,310,
4,623
Join Date: Aug 2005
Last Activity: 7 July 2020, 11:47 AM EDT
Location: Saskatchewan
Posts: 23,310
Thanks Given: 1,331
Thanked 4,623 Times in 4,217 Posts
Let me explain how limits really work. When a new process is created, limits.conf is not checked -- the process just gets the same ulimit settings as the process which created it. This is quite similar to how environment variables work, where it just gets a copy. After creation, each process is independent.
When the system starts, it runs init, which starts off every other process. It's possible to change ulimit settings here, but often isn't -- changing them here could have drastic consequences since every other process on the system would inherit them!
Among a few other things, init runs sysvinit or something like it, which begins the process of starting all your system services. This is where limits.conf starts being useful: As part of this process, each executable gets limits looked up and settings set for it before it's run.
init -> sysvinit -> look up filename in limits.conf -> Apply limits -> launch filename
The important thing is, limits are set by the parent process, before the child is created. If you're not what's running executablename, you can't change its limits, only your own and whatever processes you create.
You need to figure out this chain:
init -> sysvinit -> ??? service, or cron, or a login, what? -> process Y
...because the limit settings are applied there, when ??? is created. Not when you alter limits.conf -- when the ??? process is created.
Depending on what ??? is, it's entirely possible you could shove a ulimit line in there somewhere without doing drastic changes to limits.conf. This is what I'd recommend anyway, changing your limits globally could have big consequences.