Lines 220-225
if [ -d "@SYSCONFDIR@/rc.conf.d" ]; then
Link Here
|
220 |
done |
220 |
done |
221 |
fi |
221 |
fi |
222 |
|
222 |
|
|
|
223 |
# Stash the globally defined rc_ulimit value so that we may later determine |
224 |
# whether it was overridden by a service conf.d file. |
225 |
_global_rc_ulimit=${rc_ulimit:-$RC_ULIMIT} |
226 |
|
223 |
_conf_d=${RC_SERVICE%/*}/../conf.d |
227 |
_conf_d=${RC_SERVICE%/*}/../conf.d |
224 |
# If we're net.eth0 or openvpn.work then load net or openvpn config |
228 |
# If we're net.eth0 or openvpn.work then load net or openvpn config |
225 |
_c=${RC_SVCNAME%%.*} |
229 |
_c=${RC_SVCNAME%%.*} |
Lines 236-241
if ! sourcex -e "$_conf_d/$RC_SVCNAME.$RC_RUNLEVEL"; then
Link Here
|
236 |
fi |
240 |
fi |
237 |
unset _conf_d |
241 |
unset _conf_d |
238 |
|
242 |
|
|
|
243 |
# Stash the rc_ulimit value defined in conf.d scope so that we may later |
244 |
# determine whether the global value was overriden. |
245 |
_local_rc_ulimit=${rc_ulimit:-$RC_ULIMIT} |
246 |
|
239 |
# load service supervisor functions |
247 |
# load service supervisor functions |
240 |
sourcex "@LIBEXECDIR@/sh/runit.sh" |
248 |
sourcex "@LIBEXECDIR@/sh/runit.sh" |
241 |
sourcex "@LIBEXECDIR@/sh/s6.sh" |
249 |
sourcex "@LIBEXECDIR@/sh/s6.sh" |
Lines 253-261
fi
Link Here
|
253 |
|
261 |
|
254 |
for _cmd; do |
262 |
for _cmd; do |
255 |
if [ "$_cmd" != status -a "$_cmd" != describe ]; then |
263 |
if [ "$_cmd" != status -a "$_cmd" != describe ]; then |
256 |
# Apply any ulimit defined |
264 |
# Apply any ulimit defined. Unfortunately, this approach is |
257 |
[ -n "${rc_ulimit:-$RC_ULIMIT}" ] && \ |
265 |
# intrinsically non-portable. POSIX sh is only obligated to |
258 |
ulimit ${rc_ulimit:-$RC_ULIMIT} |
266 |
# support the -f option. Consequently, any implemented |
|
|
267 |
# extensions are prone to vary considerably. Further, popular |
268 |
# implementations such as dash don't even necessarily allow for |
269 |
# multiple option/value pairs. A better approach would be to |
270 |
# use setrlimit(2). For now, try to raise meaningful warnings |
271 |
# in the event of failure. |
272 |
if [ -n "${rc_ulimit:=$RC_ULIMIT}" ] && ! ulimit ${rc_ulimit}; then |
273 |
_sh=$(readlink /bin/sh 2>/dev/null) || _sh=sh |
274 |
ewarn "Your /bin/sh implementation ($_sh) failed to apply these rc_limit options: $rc_ulimit" |
275 |
if [ "$_global_rc_ulimit" = "$_local_rc_ulimit" ]; then |
276 |
ewarn "Please check your /etc/rc.conf and /etc/rc.conf.d files and adjust as necessary." |
277 |
else |
278 |
ewarn "Please check the conf.d file(s) for $RC_SVCNAME and adjust as necessary." |
279 |
fi |
280 |
fi |
281 |
unset _sh _global_rc_ulimit _local_rc_ulimit |
259 |
# Apply cgroups settings if defined |
282 |
# Apply cgroups settings if defined |
260 |
if [ "$(command -v cgroup_add_service)" = "cgroup_add_service" ] |
283 |
if [ "$(command -v cgroup_add_service)" = "cgroup_add_service" ] |
261 |
then |
284 |
then |