Gentoo Archives: gentoo-commits

From: Aaron Bauman <bman@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-emulation/lxc/files/
Date: Sat, 05 May 2018 01:26:24
Message-Id: 1525483339.f4441d977a0df1cc059b5ec38a2e7b66c9967f74.bman@gentoo
1 commit: f4441d977a0df1cc059b5ec38a2e7b66c9967f74
2 Author: Michael Mair-Keimberger <m.mairkeimberger <AT> gmail <DOT> com>
3 AuthorDate: Sat Apr 28 07:51:26 2018 +0000
4 Commit: Aaron Bauman <bman <AT> gentoo <DOT> org>
5 CommitDate: Sat May 5 01:22:19 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f4441d97
7
8 app-emulation/lxc: remove unused files
9
10 Closes: https://github.com/gentoo/gentoo/pull/8182
11
12 app-emulation/lxc/files/lxc.initd.3 | 117 -----------------------------------
13 app-emulation/lxc/files/lxc.initd.5 | 118 ------------------------------------
14 2 files changed, 235 deletions(-)
15
16 diff --git a/app-emulation/lxc/files/lxc.initd.3 b/app-emulation/lxc/files/lxc.initd.3
17 deleted file mode 100644
18 index 7725f571017..00000000000
19 --- a/app-emulation/lxc/files/lxc.initd.3
20 +++ /dev/null
21 @@ -1,117 +0,0 @@
22 -#!/sbin/openrc-run
23 -# Copyright 1999-2015 Gentoo Foundation
24 -# Distributed under the terms of the GNU General Public License v2
25 -
26 -CONTAINER=${SVCNAME#*.}
27 -
28 -LXC_PATH=`lxc-config lxc.lxcpath`
29 -
30 -lxc_get_configfile() {
31 - if [ -f "${LXC_PATH}/${CONTAINER}.conf" ]; then
32 - echo "${LXC_PATH}/${CONTAINER}.conf"
33 - elif [ -f "${LXC_PATH}/${CONTAINER}/config" ]; then
34 - echo "${LXC_PATH}/${CONTAINER}/config"
35 - else
36 - eerror "Unable to find a suitable configuration file."
37 - eerror "If you set up the container in a non-standard"
38 - eerror "location, please set the CONFIGFILE variable."
39 - return 1
40 - fi
41 -}
42 -
43 -[ $CONTAINER != $SVCNAME ] && CONFIGFILE=${CONFIGFILE:-$(lxc_get_configfile)}
44 -
45 -lxc_get_var() {
46 - awk 'BEGIN { FS="[ \t]*=[ \t]*" } $1 == "'$1'" { print $2; exit }' ${CONFIGFILE}
47 -}
48 -
49 -lxc_get_net_link_type() {
50 - awk 'BEGIN { FS="[ \t]*=[ \t]*"; _link=""; _type="" }
51 - $1 == "lxc.network.type" {_type=$2;}
52 - $1 == "lxc.network.link" {_link=$2;}
53 - {if(_link != "" && _type != ""){
54 - printf("%s:%s\n", _link, _type );
55 - _link=""; _type="";
56 - }; }' <${CONFIGFILE}
57 -}
58 -
59 -checkconfig() {
60 - if [ ${CONTAINER} = ${SVCNAME} ]; then
61 - eerror "You have to create an init script for each container:"
62 - eerror " ln -s lxc /etc/init.d/lxc.container"
63 - return 1
64 - fi
65 -
66 - # no need to output anything, the function takes care of that.
67 - [ -z "${CONFIGFILE}" ] && return 1
68 -
69 - utsname=$(lxc_get_var lxc.utsname)
70 - if [ ${CONTAINER} != ${utsname} ]; then
71 - eerror "You should use the same name for the service and the"
72 - eerror "container. Right now the container is called ${utsname}"
73 - return 1
74 - fi
75 -}
76 -
77 -depend() {
78 - # be quiet, since we have to run depend() also for the
79 - # non-muxed init script, unfortunately.
80 - checkconfig 2>/dev/null || return 0
81 -
82 - config ${CONFIGFILE}
83 - need localmount
84 -
85 - local _x _if
86 - for _x in $(lxc_get_net_link_type); do
87 - _if=${_x%:*}
88 - case "${_x##*:}" in
89 - # when the network type is set to phys, we can make use of a
90 - # network service (for instance to set it up before we disable
91 - # the net_admin capability), but we might also not set it up
92 - # at all on the host and leave the net_admin capable service
93 - # to take care of it.
94 - phys) use net.${_if} ;;
95 - *) need net.${_if} ;;
96 - esac
97 - done
98 -}
99 -
100 -start() {
101 - checkconfig || return 1
102 - rm -f /var/log/lxc/${CONTAINER}.log
103 -
104 - rootpath=$(lxc_get_var lxc.rootfs)
105 -
106 - # Check the format of our init and the chroot's init, to see
107 - # if we have to use linux32 or linux64; always use setarch
108 - # when required, as that makes it easier to deal with
109 - # x32-based containers.
110 - case $(scanelf -BF '%a#f' ${rootpath}/sbin/init) in
111 - EM_X86_64) setarch=linux64;;
112 - EM_386) setarch=linux32;;
113 - esac
114 -
115 - ebegin "Starting ${CONTAINER}"
116 - env -i ${setarch} $(type -p lxc-start) -l WARN -n ${CONTAINER} -f ${CONFIGFILE} -d -o /var/log/lxc/${CONTAINER}.log
117 - sleep 0.5
118 -
119 - # lxc-start -d will _always_ report a correct startup, even if it
120 - # failed, so rather than trust that, check that the cgroup exists.
121 - [ -d /sys/fs/cgroup/cpuset/lxc/${CONTAINER} ]
122 - eend $?
123 -}
124 -
125 -stop() {
126 - checkconfig || return 1
127 -
128 -
129 - if ! [ -d /sys/fs/cgroup/cpuset/lxc/${CONTAINER} ]; then
130 - ewarn "${CONTAINER} doesn't seem to be started."
131 - return 0
132 - fi
133 -
134 - # 10s should be enough to shut everything down
135 - ebegin "Stopping ${CONTAINER}"
136 - lxc-stop -t 10 -n ${CONTAINER}
137 - eend $?
138 -}
139
140 diff --git a/app-emulation/lxc/files/lxc.initd.5 b/app-emulation/lxc/files/lxc.initd.5
141 deleted file mode 100644
142 index b28d0bfa7aa..00000000000
143 --- a/app-emulation/lxc/files/lxc.initd.5
144 +++ /dev/null
145 @@ -1,118 +0,0 @@
146 -#!/sbin/openrc-run
147 -# Copyright 1999-2017 Gentoo Foundation
148 -# Distributed under the terms of the GNU General Public License v2
149 -
150 -CONTAINER=${SVCNAME#*.}
151 -
152 -LXC_PATH=`lxc-config lxc.lxcpath`
153 -
154 -lxc_get_configfile() {
155 - if [ -f "${LXC_PATH}/${CONTAINER}.conf" ]; then
156 - echo "${LXC_PATH}/${CONTAINER}.conf"
157 - elif [ -f "${LXC_PATH}/${CONTAINER}/config" ]; then
158 - echo "${LXC_PATH}/${CONTAINER}/config"
159 - else
160 - eerror "Unable to find a suitable configuration file."
161 - eerror "If you set up the container in a non-standard"
162 - eerror "location, please set the CONFIGFILE variable."
163 - return 1
164 - fi
165 -}
166 -
167 -[ $CONTAINER != $SVCNAME ] && CONFIGFILE=${CONFIGFILE:-$(lxc_get_configfile)}
168 -
169 -lxc_get_var() {
170 - awk 'BEGIN { FS="[ \t]*=[ \t]*" } $1 == "'$1'" { print $2; exit }' ${CONFIGFILE}
171 -}
172 -
173 -lxc_get_net_link_type() {
174 - awk 'BEGIN { FS="[ \t]*=[ \t]*"; _link=""; _type="" }
175 - $1 == "lxc.network.type" {_type=$2;}
176 - $1 == "lxc.network.link" {_link=$2;}
177 - {if(_link != "" && _type != ""){
178 - printf("%s:%s\n", _link, _type );
179 - _link=""; _type="";
180 - }; }' <${CONFIGFILE}
181 -}
182 -
183 -checkconfig() {
184 - if [ ${CONTAINER} = ${SVCNAME} ]; then
185 - eerror "You have to create an init script for each container:"
186 - eerror " ln -s lxc /etc/init.d/lxc.container"
187 - return 1
188 - fi
189 -
190 - # no need to output anything, the function takes care of that.
191 - [ -z "${CONFIGFILE}" ] && return 1
192 -
193 - utsname=$(lxc_get_var lxc.utsname)
194 - if [ ${CONTAINER} != ${utsname} ]; then
195 - eerror "You should use the same name for the service and the"
196 - eerror "container. Right now the container is called ${utsname}"
197 - return 1
198 - fi
199 -}
200 -
201 -depend() {
202 - # be quiet, since we have to run depend() also for the
203 - # non-muxed init script, unfortunately.
204 - checkconfig 2>/dev/null || return 0
205 -
206 - config ${CONFIGFILE}
207 - need localmount
208 - use lxcfs
209 -
210 - local _x _if
211 - for _x in $(lxc_get_net_link_type); do
212 - _if=${_x%:*}
213 - case "${_x##*:}" in
214 - # when the network type is set to phys, we can make use of a
215 - # network service (for instance to set it up before we disable
216 - # the net_admin capability), but we might also not set it up
217 - # at all on the host and leave the net_admin capable service
218 - # to take care of it.
219 - phys) use net.${_if} ;;
220 - *) need net.${_if} ;;
221 - esac
222 - done
223 -}
224 -
225 -start() {
226 - checkconfig || return 1
227 - rm -f /var/log/lxc/${CONTAINER}.log
228 -
229 - rootpath=$(lxc_get_var lxc.rootfs)
230 -
231 - # Check the format of our init and the chroot's init, to see
232 - # if we have to use linux32 or linux64; always use setarch
233 - # when required, as that makes it easier to deal with
234 - # x32-based containers.
235 - case $(scanelf -BF '%a#f' ${rootpath}/sbin/init) in
236 - EM_X86_64) setarch=linux64;;
237 - EM_386) setarch=linux32;;
238 - esac
239 -
240 - ebegin "Starting ${CONTAINER}"
241 - env -i ${setarch} $(which lxc-start) -l WARN -n ${CONTAINER} -f ${CONFIGFILE} -d -o /var/log/lxc/${CONTAINER}.log
242 - sleep 0.5
243 -
244 - # lxc-start -d will _always_ report a correct startup, even if it
245 - # failed, so rather than trust that, check that the cgroup exists.
246 - [ -d /sys/fs/cgroup/cpuset/lxc/${CONTAINER} ]
247 - eend $?
248 -}
249 -
250 -stop() {
251 - checkconfig || return 1
252 -
253 -
254 - if ! [ -d /sys/fs/cgroup/cpuset/lxc/${CONTAINER} ]; then
255 - ewarn "${CONTAINER} doesn't seem to be started."
256 - return 0
257 - fi
258 -
259 - # 10s should be enough to shut everything down
260 - ebegin "Stopping ${CONTAINER}"
261 - lxc-stop -t 10 -n ${CONTAINER}
262 - eend $?
263 -}