I was reading this answer to a question on setting limits for processes by using cgroups. The sample given sets limits for a process (in the example,
sshd). In the answer, the PID of the process is set manually. This would be unacceptable for my purposes, I would like that processes started from a given application to always have the limits set, no matter when they are started nor limited by how many such processes are started.
Perhaps it is unclear from the example how that would happen, so a clear explanation or link to one would also be welcome. The example in the kernel cgroups.txt seems to use the same model as already given above.