File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -289,27 +289,27 @@ if yesno "${rc_verbose:-$RC_VERBOSE}"; then
289289 export EINFO_VERBOSE
290290fi
291291
292- case $1 in
293- status|describe) ;;
294- * )
295- # Apply any ulimit(s) defined
296- [ -n " ${rc_ulimit:- $RC_ULIMIT } " ] && apply_ulimits ${rc_ulimit:- $RC_ULIMIT }
297-
292+ _setup_cgroup () {
298293 # Apply cgroups settings if defined
299294 if [ " $( command -v cgroup_add_service) " = " cgroup_add_service" ]; then
300- if grep -qs /sys/fs/cgroup /proc/1/mountinfo
301- then
302- if [ -d /sys/fs/cgroup -a ! -w /sys/fs/cgroup ]; then
303- eerror " No permission to apply cgroup settings"
304- break
305- fi
295+ if grep -qs /sys/fs/cgroup /proc/1/mountinfo && [ -d /sys/fs/cgroup ] && ! [ -w /sys/fs/cgroup ]; then
296+ eerror " No permission to apply cgroup settings"
297+ return
306298 fi
307299 cgroup_add_service
308300 fi
309301
310302 [ " $( command -v cgroup_set_limits) " = " cgroup_set_limits" ] && cgroup_set_limits
311303 [ " $( command -v cgroup2_set_limits) " = " cgroup2_set_limits" ] && cgroup2_set_limits
312- ;;
304+ }
305+
306+ case $1 in
307+ status|describe) ;;
308+ * )
309+ # Apply any ulimit(s) defined
310+ [ -n " ${rc_ulimit:- $RC_ULIMIT } " ] && apply_ulimits ${rc_ulimit:- $RC_ULIMIT }
311+ _setup_cgroup
312+ ;;
313313esac
314314
315315eval " printf '%s\n' $required_dirs " | while read _d; do
You can’t perform that action at this time.
0 commit comments