Hi!

I configured freshly installed OpenBSD 6.0-release with

kern.maxfiles=131072

in /etc/sysctl.conf
and

:openfiles-max=40960:openfiles-cur=40960:

for daemon in /etc/login.conf

And at each boot I see message:
kern.maxfiles: 7030 -> 131072
/etc/rc: ulimit: bad -n limit: Invalid argument

I looked at /etc/rc and found that script at first step call 'ulimit -S
-n ' for value found for '-cur' and at second step call 'ulimit -H -n '
for value found for '-max'. That is incorrect as soft limit can't be set
to higher value than hard limit. Moreover, I can't just use
":openfiles=40960:" for daemon class because "default" class has both
"-max" and "-cur" values - as result: at first step "40960" used for
both hard and soft limit, but immediately lowered by using "-cur" and
"-max" values from "default" class (getcap return them for "daemon"
class as well).

As current workaround I use

:openfiles=40960:openfiles-max=40960:openfiles-cur=40960:

but it is not really elegant solution.


I this that at least order of suffix checking in /etc/rc must be changed
from
"for _suffix in {,-cur,-max}; do"
to
"for _suffix in {,-max,-cur}; do"


Am I right? Or I missed something?

-- 
Best Wishes,
Evgeny Grin

Reply via email to