Short answer: this is working as intended - manual steps are needed to make this work.
This isn’t a bug. By default pam_limits isn’t enabled for console logins and several other ways to switch user.
I’ve researched several other distributions and I don’t see this done differently in other distro’s (maybe there are some, but it appears at least that this isn’t standard).
The reason is pam_limits isn’t included in su or login or common-auth pam files. You can still manually set this up:
copy common-auth, su and maybe others from /usr/share/pam.d to /etc/pam.d
Modify it and add session required pam_limits.so to the relevant ones
create your /etc/security/limits.conf file as needed
I am on 31810 and still have no success with niceness. Did all the steps above.
alekperov@DS-IAACLR/etc/pam.d nice -n -20 vi common-session
**nice: cannot set niceness: Permission denied**
alekperov@DS-IAACLR/etc/pam.d sudo swupd check-update
Current OS version: 31810
Latest server version: 31810
There are no updates available
@ahkok I have sent a message to you with my configs. I have many lines in /etc/pam.d/common-session, maybe some of them override line with session required pam_limits.so ?
Still niceness does not work as expected. Please see my direct message. Please help.