limits in /etc/passwd, and maybe a bug in processing /etc/limits? :)
OK. As a continuation of my previous ramblings on resource limits, I'm
running into two more similar issues on my slink machine.
According to /etc/login.defs, I should be able to employ resource limits
by editing users' passwd entries. I have "QUOTAS_ENAB" in login.defs:
# Enable setting of ulimit, umask, and niceness from passwd gecos field.
#
QUOTAS_ENAB yes
If I look at man 5 passwd, I see the following:
The comment field is used by various system utilities,
such as finger(1). Three additional values may be present
in the comment field. They are
pri= - set initial value of nice
umask= - set initial value of umask
ulimit= - set initial value of ulimit
These fields are separated from each other and from any
other comment field by a comma.
I tried to set the umask to 022 this way with a test account, and I can't
get it to do anything at all.
I have tried adding "extra" comment entries by adding commas in
/etc/passwd, and I've also tried using the pre-existing comment
entries. None of it works. I end up with the default umask of 002 no
matter what... and yes I have commented-out the umask field in
/etc/profile, and there is none in the test user's .bash_profile,
.profile, and .bashrc. :)
Anyone know the right way to do it?
My second problem... well, it looks like it may be a bug. Note the
following text in /etc/limits:
# Valid flags are:
# A: max address space (KB)
# C: max core file size (KB)
# D: max data size (KB)
... and so on.
But any time I use the "A" limit, the whole line becomes useless. See the
following in man 5 limits:
"A invalid limits string will be rejected (not considered) by the login
program."
If I take out the "A" limit, the rest of the line functions again. So
there seems to be some kind of problem reading or enforcing this limit.
So a line like this:
* L2 D12288 M32768 R2048 S2048 U64 N256 F16384 T60 C0
works fine.
But one like this:
* A32768 L2 D12288 M32768 R2048 S2048 U64 N256 F16384 T60 C0
breaks the whole line and NO limits are enforced.
Is this a bug or am I doing something wrong (again)? :)
Reply to: