From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 887CF1396D2 for ; Thu, 14 Sep 2017 15:57:25 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E92571FC0AE; Thu, 14 Sep 2017 15:57:24 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id C6B541FC0AE for ; Thu, 14 Sep 2017 15:57:24 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id C984D33BE2E for ; Thu, 14 Sep 2017 15:57:23 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id A275B907F for ; Thu, 14 Sep 2017 15:57:21 +0000 (UTC) From: "William Hubbs" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "William Hubbs" Message-ID: <1505403892.8885580986ab8adc951fe32b9323c8b16130fb4f.williamh@OpenRC> Subject: [gentoo-commits] proj/openrc:master commit in: sh/ X-VCS-Repository: proj/openrc X-VCS-Files: sh/rc-cgroup.sh.in X-VCS-Directories: sh/ X-VCS-Committer: williamh X-VCS-Committer-Name: William Hubbs X-VCS-Revision: 8885580986ab8adc951fe32b9323c8b16130fb4f X-VCS-Branch: master Date: Thu, 14 Sep 2017 15:57:21 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 99c6cc4b-f626-4072-950f-1cf40a2e75d6 X-Archives-Hash: 27d1922d0337bd076f99256b3c81fe9e commit: 8885580986ab8adc951fe32b9323c8b16130fb4f Author: William Hubbs gmail com> AuthorDate: Thu Sep 14 15:44:52 2017 +0000 Commit: William Hubbs gentoo org> CommitDate: Thu Sep 14 15:44:52 2017 +0000 URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=88855809 rc-cgroup.sh: move cgroup_cleanup to the end of the file sh/rc-cgroup.sh.in | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/sh/rc-cgroup.sh.in b/sh/rc-cgroup.sh.in index 40501f22..1bf819e7 100644 --- a/sh/rc-cgroup.sh.in +++ b/sh/rc-cgroup.sh.in @@ -134,25 +134,6 @@ cgroup_set_limits() return 0 } -cgroup_cleanup() -{ - cgroup_running || return 0 - ebegin "starting cgroups cleanup" - for sig in TERM QUIT INT; do - cgroup_get_pids || { eend 0 "finished" ; return 0 ; } - for i in 0 1; do - kill -s $sig $pids - for j in 0 1 2; do - cgroup_get_pids || { eend 0 "finished" ; return 0 ; } - sleep 1 - done - done 2>/dev/null - done - cgroup_get_pids || { eend 0 "finished" ; return 0; } - kill -9 $pids - eend $(cgroup_running && echo 1 || echo 0) "fail to stop all processes" -} - cgroup2_find_path() { case "${rc_cgroup_mode:-hybrid}" in @@ -203,3 +184,22 @@ cgroup2_set_limits() IFS="$OIFS" return 0 } + +cgroup_cleanup() +{ + cgroup_running || return 0 + ebegin "starting cgroups cleanup" + for sig in TERM QUIT INT; do + cgroup_get_pids || { eend 0 "finished" ; return 0 ; } + for i in 0 1; do + kill -s $sig $pids + for j in 0 1 2; do + cgroup_get_pids || { eend 0 "finished" ; return 0 ; } + sleep 1 + done + done 2>/dev/null + done + cgroup_get_pids || { eend 0 "finished" ; return 0; } + kill -9 $pids + eend $(cgroup_running && echo 1 || echo 0) "fail to stop all processes" +}