Summary: | app-shells/bash: `ulimit` in man page should mention POSIX mode block size differences | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Agostino Sarubbo <ago> |
Component: | [OLD] Core system | Assignee: | Gentoo's Team for Core System packages <base-system> |
Status: | RESOLVED UPSTREAM | ||
Severity: | normal | CC: | whissi |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
URL: | https://lists.gnu.org/archive/html/bug-bash/2015-06/msg00020.html | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Agostino Sarubbo
2015-05-12 07:28:13 UTC
@base-system: Can you advise me on this one? Thanks, William @samba: Can you also take a look and advise me? Thanks, William I don't think the problem originates in openrc. runscript.sh, which handles the rc_ulimit variable, simply calls the shell primitive It's also not limited to samba, I added rc_ulimit='-f 16' (so a 16KB limit) to fakeidentd, which is an extremely simple program (~500 lines of C, does nothing to limits itself); and here is the result: # grep file /proc/`pidof fakeidentd`/limits Max file size 8192 8192 bytes Max core file size 0 unlimited bytes Max open files 1024 4096 files Max file locks unlimited unlimited lock My bet is on bash or libc, but I need to confirm this still. The help for bash describes how most limits are actually 1k multiples (except for one that is a 512-byte multiple, and some that are singular). Solved it! We're in POSIX bash mode, and block size is defined as 512-byte, not 1K. The help output and manpage for Bash don't explicitly say, but they do reference this document, that covers it: http://tiswww.case.edu/php/chet/bash/POSIX 48. The `ulimit' builtin uses a block size of 512 bytes for the `-c' and `-f' options. Since OpenRC is used with dash and other posix-correct shells, I think the actions taken should be: 1. Amend the bash help & manpage to mention the blocksize variation on mode. 2. Add a comment to rc.conf about it as well. In OpenRC, I added a note about this in commit bbabf54 which will be part of OpenRC-0.17. All, this has been documented in OpenRC-0.16.4, so I am assigning to base-system since the other suggestion Robin made is to modify the bash help. Thanks, William sent the patch upstream: https://lists.gnu.org/archive/html/bug-bash/2015-06/msg00020.html |