Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 681370 Details for
Bug 739274
sys-apps/openrc with app-shells/dash - /lib/rc/sh/openrc-run.sh: 258: ulimit: too many arguments
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
openrc-raise-useful-warnings-if-ulimit-fails-r1.patch
openrc-raise-useful-warnings-if-ulimit-fails-r1.patch (text/plain), 3.40 KB, created by
kfm
on 2021-01-06 01:14:46 UTC
(
hide
)
Description:
openrc-raise-useful-warnings-if-ulimit-fails-r1.patch
Filename:
MIME Type:
Creator:
kfm
Created:
2021-01-06 01:14:46 UTC
Size:
3.40 KB
patch
obsolete
>commit 0198e929610d92e035a3b126933c8dd4cc1c0b60 >Author: Kerin Millar <kfm@plushkava.net> >Date: Wed Jan 6 01:13:05 2021 +0000 > > Raise useful warnings in the case that ulimit fails > > Unfortunately, the means by which OpenRC allows for the configuration of > resource limits is intrinsically non-portable. POSIX sh is only > obligated to support the -f option. Consequently, any implemented > extensions are prone to vary considerably. Further, popular > implementations such as dash don't even necessarily allow for multiple > option/value pairs. A better approach would be to use setrlimit(2). > > For now, try to raise meaningful warnings in the event of failure. This > is accomplished by stashing the effective value of rc_ulimit both after > importing the global config files and after importing any config files > specific to the service. After ulimit is invoked, the exit status is > checked. In the case that it has failed, a warning message is emitted > which reports the sh implementation and the options that were given > (because the shell might not report them). It also suggests that the > configuration files most likely to be responsible for the issue be > edited and advises the user of the service name, where appropriate. > >diff --git a/sh/openrc-run.sh.in b/sh/openrc-run.sh.in >index 7e9064c2..810df66c 100644 >--- a/sh/openrc-run.sh.in >+++ b/sh/openrc-run.sh.in >@@ -220,6 +220,10 @@ if [ -d "@SYSCONFDIR@/rc.conf.d" ]; then > done > fi > >+# Stash the globally defined rc_ulimit value so that we may later determine >+# whether it was overridden by a service conf.d file. >+_global_rc_ulimit=${rc_ulimit:-$RC_ULIMIT} >+ > _conf_d=${RC_SERVICE%/*}/../conf.d > # If we're net.eth0 or openvpn.work then load net or openvpn config > _c=${RC_SVCNAME%%.*} >@@ -236,6 +240,10 @@ if ! sourcex -e "$_conf_d/$RC_SVCNAME.$RC_RUNLEVEL"; then > fi > unset _conf_d > >+# Stash the rc_ulimit value defined in conf.d scope so that we may later >+# determine whether the global value was overriden. >+_local_rc_ulimit=${rc_ulimit:-$RC_ULIMIT} >+ > # load service supervisor functions > sourcex "@LIBEXECDIR@/sh/runit.sh" > sourcex "@LIBEXECDIR@/sh/s6.sh" >@@ -253,9 +261,24 @@ fi > > for _cmd; do > if [ "$_cmd" != status -a "$_cmd" != describe ]; then >- # Apply any ulimit defined >- [ -n "${rc_ulimit:-$RC_ULIMIT}" ] && \ >- ulimit ${rc_ulimit:-$RC_ULIMIT} >+ # Apply any ulimit defined. Unfortunately, this approach is >+ # intrinsically non-portable. POSIX sh is only obligated to >+ # support the -f option. Consequently, any implemented >+ # extensions are prone to vary considerably. Further, popular >+ # implementations such as dash don't even necessarily allow for >+ # multiple option/value pairs. A better approach would be to >+ # use setrlimit(2). For now, try to raise meaningful warnings >+ # in the event of failure. >+ if [ -n "${rc_ulimit:=$RC_ULIMIT}" ] && ! ulimit ${rc_ulimit}; then >+ _sh=$(readlink /bin/sh 2>/dev/null) || _sh=sh >+ ewarn "/bin/sh ($_sh) failed to apply these rc_ulimit options: $rc_ulimit" >+ if [ "$_global_rc_ulimit" = "$_local_rc_ulimit" ]; then >+ ewarn "Please check the /etc/rc.conf and /etc/rc.conf.d files and adjust as necessary." >+ else >+ ewarn "Please check the conf.d file(s) for $RC_SVCNAME and adjust as necessary." >+ fi >+ fi >+ unset _sh _global_rc_ulimit _local_rc_ulimit > # Apply cgroups settings if defined > if [ "$(command -v cgroup_add_service)" = "cgroup_add_service" ] > then
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 739274
:
681355
| 681370