Is there a way to restrict system resources to users? I know that used to exist a way of forcing every newly spawned process of a user into the specified cgroup by using cgred service along with /etc/cgconfig.conf file, as explained here How can I configure cgroups to fairly share resources between users?.
However, this approach seems to be deprecated and the only way I've found is to modify cgroup attributes here /sys/fs/cgroup/user.slice/user-${UID}.slice by using systemctl set-property utility, the problem with this is that systemd creates this cgroup only when the user is logged, it gets removed as soon as user logs out. I am finding a way to restrict user resources even if he is logged out.