Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/libcgroup/files/
Date: Sat, 21 Sep 2019 09:15:54
Message-Id: 1569057322.852cd2d935f8630c4ab51e159669db75765b2862.mgorny@gentoo
1 commit: 852cd2d935f8630c4ab51e159669db75765b2862
2 Author: Bernardo Meurer <bernardo <AT> standard <DOT> ai>
3 AuthorDate: Sat Sep 21 07:10:07 2019 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Sat Sep 21 09:15:22 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=852cd2d9
7
8 dev-libs/libcgroup: yank old files
9
10 Package-Manager: Portage-2.3.76, Repoman-2.3.17
11 Signed-off-by: Bernardo Meurer <bernardo <AT> standard.ai>
12 Closes: https://github.com/gentoo/gentoo/pull/12652
13 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
14
15 dev-libs/libcgroup/files/cgconfig.confd | 4 --
16 dev-libs/libcgroup/files/cgconfig.initd | 117 --------------------------------
17 dev-libs/libcgroup/files/cgred.confd | 17 -----
18 dev-libs/libcgroup/files/cgred.initd | 41 -----------
19 4 files changed, 179 deletions(-)
20
21 diff --git a/dev-libs/libcgroup/files/cgconfig.confd b/dev-libs/libcgroup/files/cgconfig.confd
22 deleted file mode 100644
23 index e41730ae0ea..00000000000
24 --- a/dev-libs/libcgroup/files/cgconfig.confd
25 +++ /dev/null
26 @@ -1,4 +0,0 @@
27 -# /etc/conf.d/cgconfig: config file for /etc/init.d/cgconfig
28 -
29 -# Configuration file location
30 -#CONFIG_FILE=/etc/cgroup/cgconfig.conf
31
32 diff --git a/dev-libs/libcgroup/files/cgconfig.initd b/dev-libs/libcgroup/files/cgconfig.initd
33 deleted file mode 100644
34 index f182b92ff84..00000000000
35 --- a/dev-libs/libcgroup/files/cgconfig.initd
36 +++ /dev/null
37 @@ -1,117 +0,0 @@
38 -#!/sbin/openrc-run
39 -#
40 -# Control Groups Configuration Startup
41 -#
42 -# This script runs the cgconfigparser utility to parse and setup
43 -# the control group filesystem. It uses ${CONFIG_FILE}
44 -# and parses the configuration specified in there.
45 -#
46 -CGCONFIGPARSER="/usr/sbin/cgconfigparser"
47 -CGROUP_FS="cgroup"
48 -CONFIG_FILE=${CONFIG_FILE:-"/etc/cgroup/cgconfig.conf"}
49 -MOUNTS_FILE="/proc/mounts"
50 -RULES_FILE="/etc/cgroup/cgrules.conf"
51 -
52 -# Support multiple mount points
53 -MAX_INDEX=0
54 -declare -a MOUNT_POINTS MOUNT_OPTIONS
55 -
56 -move_all_to_init_class() {
57 - local i
58 - for i in $(seq 1 ${MAX_INDEX}); do
59 - cd ${MOUNT_POINTS[$i]}
60 -
61 - if grep -qw ${MOUNT_POINTS[$i]} ${MOUNTS_FILE}; then
62 - local directory
63 - for directory in $(find . -depth -type d); do
64 - if [[ ${directory} != "." ]]; then
65 - # cat fails with "Argument list too long" error
66 - sed -nu p < ${directory}/tasks > tasks
67 - rmdir ${directory}
68 - fi
69 - done
70 - else
71 - ewarn "Resource control filesystem not mounted"
72 - fi
73 -
74 - cd - >/dev/null
75 - done
76 -}
77 -
78 -parse_mounts() {
79 - local device mount_point fs_type options other
80 - while read device mount_point fs_type options other; do
81 - if grep -q ${device} <<< ${CGROUP_FS}; then
82 - let MAX_INDEX++
83 - MOUNT_POINTS[${MAX_INDEX}]=${mount_point}
84 - MOUNT_OPTIONS[${MAX_INDEX}]=${options}
85 - fi
86 - done < ${MOUNTS_FILE}
87 -}
88 -
89 -umount_fs() {
90 - local i
91 - for i in $(seq 1 ${MAX_INDEX}); do
92 - umount ${MOUNT_POINTS[$i]}
93 - rmdir ${MOUNT_POINTS[$i]}
94 - done
95 -}
96 -
97 -start() {
98 - ebegin "Starting cgconfig service"
99 -
100 - # Mount filesystem and create cgroups
101 - if ! ${CGCONFIGPARSER} -l ${CONFIG_FILE} >/dev/null; then
102 - eend 1 "Failed to parse ${CONFIG_FILE}"
103 - return 1
104 - fi
105 -
106 - parse_mounts
107 -
108 - # Find default cgroup name in rules file
109 - local default_cgroup
110 - if [[ -f ${RULES_FILE} ]]; then
111 - local user controller
112 - read user controller default_cgroup <<< $(grep -m1 '^\*\s' ${RULES_FILE})
113 - if [[ $default_cgroup == "*" ]]; then
114 - ewarn "${RULES_FILE} incorrect"
115 - ewarn "Overriding it"
116 - default_cgroup=
117 - fi
118 - fi
119 - # Use predefined name if none was found
120 - if [[ -z ${default_cgroup} ]]; then
121 - default_cgroup=sysdefault
122 - fi
123 -
124 - # Create a default cgroup for tasks to return back to
125 - local i
126 - for i in $(seq 1 ${MAX_INDEX}); do
127 - # Ignore if directory already exists
128 - mkdir -p ${MOUNT_POINTS[$i]}/${default_cgroup}
129 - find ${MOUNT_POINTS[$i]}/ -name tasks | xargs chmod a+rw
130 - chmod go-w ${MOUNT_POINTS[$i]}/tasks
131 -
132 - # Special rule for cpusets
133 - if grep -qw cpuset <<< ${MOUNT_OPTIONS[$i]}; then
134 - cat ${MOUNT_POINTS[$i]}/cpuset.cpus > ${MOUNT_POINTS[$i]}/${default_cgroup}/cpuset.cpus
135 - cat ${MOUNT_POINTS[$i]}/cpuset.mems > ${MOUNT_POINTS[$i]}/${default_cgroup}/cpuset.mems
136 - fi
137 -
138 - # Classify everything to default cgroup
139 - local j
140 - for j in $(ps --no-headers -eL o tid); do
141 - echo $j > ${MOUNT_POINTS[$i]}/${default_cgroup}/tasks 2>/dev/null
142 - done
143 - done
144 -
145 - eend 0
146 -}
147 -
148 -stop() {
149 - ebegin "Stopping cgconfig service"
150 - parse_mounts
151 - move_all_to_init_class
152 - umount_fs
153 - eend 0
154 -}
155
156 diff --git a/dev-libs/libcgroup/files/cgred.confd b/dev-libs/libcgroup/files/cgred.confd
157 deleted file mode 100644
158 index 663ffc0c7db..00000000000
159 --- a/dev-libs/libcgroup/files/cgred.confd
160 +++ /dev/null
161 @@ -1,17 +0,0 @@
162 -# /etc/conf.d/cgred.conf: config file for /etc/init.d/cgred
163 -
164 -# Uncomment the following line to log to specified file instead of syslog
165 -#LOG_FILE="/var/log/cgrulesengd.log"
166 -
167 -# Uncomment the second line to run CGroup Rules Engine in non-daemon mode
168 -#NODAEMON=""
169 -NODAEMON="--nodaemon"
170 -
171 -# Uncomment the second line to disable logging for CGroup Rules Engine
172 -# Uncomment the third line to enable more verbose logging.
173 -#LOG=""
174 -LOG="--nolog"
175 -#LOG="-v"
176 -
177 -# PID file
178 -PID_FILE=/var/run/cgred.pid
179
180 diff --git a/dev-libs/libcgroup/files/cgred.initd b/dev-libs/libcgroup/files/cgred.initd
181 deleted file mode 100644
182 index d507e09a815..00000000000
183 --- a/dev-libs/libcgroup/files/cgred.initd
184 +++ /dev/null
185 @@ -1,41 +0,0 @@
186 -#!/sbin/openrc-run
187 -#
188 -# CGroups Rules Engine Daemon
189 -#
190 -# This is a daemon for automatically classifying processes into cgroups based
191 -# on UID/GID.
192 -#
193 -opts="${opts} reload"
194 -
195 -CGRULESENGD="/usr/sbin/cgrulesengd"
196 -PID_FILE=${PID_FILE:-"/var/run/cgred.pid"}
197 -
198 -depend() {
199 - need cgconfig
200 - use logger
201 -}
202 -
203 -start() {
204 - local options="${NODAEMON} ${LOG}"
205 - if [[ -n "${LOG_FILE}" ]]; then
206 - options="${options} --log-file=${LOG_FILE}"
207 - fi
208 -
209 - ebegin "Starting CGroup Rules Engine Daemon"
210 - start-stop-daemon --start --pidfile "${PID_FILE}" --make-pidfile \
211 - --background --exec "${CGRULESENGD}" -- ${options} >/dev/null
212 - eend $?
213 -}
214 -
215 -stop() {
216 - ebegin "Stopping CGroup Rules Engine Daemon"
217 - start-stop-daemon --stop --pidfile "${PID_FILE}" --exec "${CGRULESENGD}"
218 - eend $?
219 -}
220 -
221 -reload() {
222 - ebegin "Reloading CGroup Rules Engine Daemon"
223 - start-stop-daemon --stop --signal USR2 --oknodo --background \
224 - --pidfile "${PID_FILE}" --make-pidfile --exec "${CGRULESENGD}"
225 - eend $?
226 -}