1 |
idella4 13/12/06 23:34:11 |
2 |
|
3 |
Modified: xenstored.initd xenconsoled.initd |
4 |
Added: xenqemudev.confd xencommons.initd xencommons.confd |
5 |
xenqemudev.initd |
6 |
Log: |
7 |
revbump; the gentoo styling of xencommon script split into the new 4 files, patching prepared by up and coming dlan |
8 |
|
9 |
(Portage version: 2.2.0/cvs/Linux x86_64, signed Manifest commit with key 0xB8072B0D) |
10 |
|
11 |
Revision Changes Path |
12 |
1.11 app-emulation/xen-tools/files/xenstored.initd |
13 |
|
14 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/xen-tools/files/xenstored.initd?rev=1.11&view=markup |
15 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/xen-tools/files/xenstored.initd?rev=1.11&content-type=text/plain |
16 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/xen-tools/files/xenstored.initd?r1=1.10&r2=1.11 |
17 |
|
18 |
Index: xenstored.initd |
19 |
=================================================================== |
20 |
RCS file: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/files/xenstored.initd,v |
21 |
retrieving revision 1.10 |
22 |
retrieving revision 1.11 |
23 |
diff -u -r1.10 -r1.11 |
24 |
--- xenstored.initd 27 Jul 2013 15:50:36 -0000 1.10 |
25 |
+++ xenstored.initd 6 Dec 2013 23:34:11 -0000 1.11 |
26 |
@@ -1,18 +1,19 @@ |
27 |
#!/sbin/runscript |
28 |
# Copyright 1999-2013 Gentoo Foundation |
29 |
# Distributed under the terms of the GNU General Public License v2 |
30 |
-# $Header: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/files/xenstored.initd,v 1.10 2013/07/27 15:50:36 idella4 Exp $ |
31 |
+# $Header: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/files/xenstored.initd,v 1.11 2013/12/06 23:34:11 idella4 Exp $ |
32 |
|
33 |
depend() { |
34 |
- before xendomains xend sshd ntp-client ntpd nfs nfsmount rsyncd portmap dhcp |
35 |
+ before xendomains xend sshd ntp-client ntpd nfs nfsmount rsyncd portmap dhcp |
36 |
+ need xencommons |
37 |
} |
38 |
|
39 |
start() { |
40 |
! [ -x /run/xen ] && mkdir -p /run/xen |
41 |
ebegin "Starting xenstored daemon" |
42 |
start-stop-daemon --start --exec /usr/sbin/xenstored \ |
43 |
- --pidfile /var/run/xenstored.pid \ |
44 |
- -- --pid-file=/var/run/xenstored.pid \ |
45 |
+ --pidfile /run/xenstored.pid \ |
46 |
+ -- --pid-file=/run/xenstored.pid \ |
47 |
$XENSTORED_OPTS |
48 |
until xenstore-exists \ || ((15 < ++i)) |
49 |
do |
50 |
@@ -27,6 +28,6 @@ |
51 |
stop() { |
52 |
ebegin "Stopping xenstored daemon" |
53 |
start-stop-daemon --stop --exec /usr/sbin/xenstored \ |
54 |
- --pidfile /var/run/xenstored.pid |
55 |
+ --pidfile /run/xenstored.pid |
56 |
eend $? |
57 |
} |
58 |
|
59 |
|
60 |
|
61 |
1.3 app-emulation/xen-tools/files/xenconsoled.initd |
62 |
|
63 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/xen-tools/files/xenconsoled.initd?rev=1.3&view=markup |
64 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/xen-tools/files/xenconsoled.initd?rev=1.3&content-type=text/plain |
65 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/xen-tools/files/xenconsoled.initd?r1=1.2&r2=1.3 |
66 |
|
67 |
Index: xenconsoled.initd |
68 |
=================================================================== |
69 |
RCS file: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/files/xenconsoled.initd,v |
70 |
retrieving revision 1.2 |
71 |
retrieving revision 1.3 |
72 |
diff -u -r1.2 -r1.3 |
73 |
--- xenconsoled.initd 27 Jul 2013 15:50:36 -0000 1.2 |
74 |
+++ xenconsoled.initd 6 Dec 2013 23:34:11 -0000 1.3 |
75 |
@@ -1,7 +1,7 @@ |
76 |
#!/sbin/runscript |
77 |
# Copyright 1999-2013 Gentoo Foundation |
78 |
# Distributed under the terms of the GNU General Public License v2 |
79 |
-# $Header: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/files/xenconsoled.initd,v 1.2 2013/07/27 15:50:36 idella4 Exp $ |
80 |
+# $Header: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/files/xenconsoled.initd,v 1.3 2013/12/06 23:34:11 idella4 Exp $ |
81 |
|
82 |
depend() { |
83 |
need xenstored |
84 |
@@ -10,15 +10,15 @@ |
85 |
start() { |
86 |
ebegin "Starting xenconsoled daemon" |
87 |
start-stop-daemon --start --exec /usr/sbin/xenconsoled \ |
88 |
- --pidfile /var/run/xenconsoled.pid \ |
89 |
- -- --pid-file=/var/run/xenconsoled.pid \ |
90 |
+ --pidfile /run/xenconsoled.pid \ |
91 |
+ -- --pid-file=/run/xenconsoled.pid \ |
92 |
${XENCONSOLED_OPTS} |
93 |
eend $* |
94 |
} |
95 |
|
96 |
stop() { |
97 |
- ebegin "Stoping xenconsoled daemon" |
98 |
+ ebegin "Stopping xenconsoled daemon" |
99 |
start-stop-daemon --stop --exec /usr/sbin/xenconsoled \ |
100 |
- --pidfile /var/run/xenconsoled.pid |
101 |
+ --pidfile run/xenconsoled.pid |
102 |
eend $* |
103 |
} |
104 |
|
105 |
|
106 |
|
107 |
1.1 app-emulation/xen-tools/files/xenqemudev.confd |
108 |
|
109 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/xen-tools/files/xenqemudev.confd?rev=1.1&view=markup |
110 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/xen-tools/files/xenqemudev.confd?rev=1.1&content-type=text/plain |
111 |
|
112 |
Index: xenqemudev.confd |
113 |
=================================================================== |
114 |
# /etc/conf.d/xenqemudev |
115 |
|
116 |
# To enable QEMU file backend, set to 'yes' |
117 |
XENQEMUDEV_FILE_BACKEND_ENABLE="" |
118 |
|
119 |
# Common options for xenqemudev |
120 |
XENQEMUDEV_OPTS="" |
121 |
|
122 |
|
123 |
|
124 |
1.1 app-emulation/xen-tools/files/xencommons.initd |
125 |
|
126 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/xen-tools/files/xencommons.initd?rev=1.1&view=markup |
127 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/xen-tools/files/xencommons.initd?rev=1.1&content-type=text/plain |
128 |
|
129 |
Index: xencommons.initd |
130 |
=================================================================== |
131 |
#!/sbin/runscript |
132 |
# Copyright 1999-2013 Gentoo Foundation |
133 |
# Distributed under the terms of the GNU General Public License v2 |
134 |
# $Header: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/files/xencommons.initd,v 1.1 2013/12/06 23:34:11 idella4 Exp $ |
135 |
|
136 |
depend() { |
137 |
before xenstored |
138 |
} |
139 |
|
140 |
is_privileged_domain() { |
141 |
grep -qsE '^control_d$' /proc/xen/capabilities |
142 |
return $? |
143 |
} |
144 |
|
145 |
handle_kernel_modules() { |
146 |
local XEN_DEFAULT_KERNEL_MODULES=" |
147 |
xen-evtchn |
148 |
xen-gntdev |
149 |
xen-gntalloc |
150 |
xen-blkback |
151 |
xen-netback |
152 |
xen-pciback |
153 |
gntdev |
154 |
netbk |
155 |
blkbk |
156 |
xen-scsibk |
157 |
usbbk |
158 |
pciback |
159 |
xen-acpi-processor |
160 |
blktap2 |
161 |
blktap |
162 |
" |
163 |
|
164 |
[ "$1" = "remove" ] && OPTS="-r" |
165 |
|
166 |
XEN_KERNEL_MODULES="${XEN_KERNEL_MODULES:-${XEN_DEFAULT_KERNEL_MODULES}}" |
167 |
for i in ${XEN_KERNEL_MODULES}; do |
168 |
modprobe ${OPTS} $i 2>/dev/null |
169 |
done |
170 |
return 0 |
171 |
} |
172 |
|
173 |
start() { |
174 |
ebegin "Starting xencommons daemon" |
175 |
|
176 |
# not running in Xen dom0 or domU |
177 |
if [ ! -d /proc/xen ]; then |
178 |
eend 1 "Not running in Xen mode" |
179 |
return 1 |
180 |
fi |
181 |
|
182 |
# mount xenfs in dom0 or domU with a pv_ops kernel |
183 |
if ! test -f /proc/xen/capabilities && \ |
184 |
! grep '^xenfs ' /proc/mounts >/dev/null; |
185 |
then |
186 |
mount -t xenfs xenfs /proc/xen |
187 |
fi |
188 |
|
189 |
if ! is_privileged_domain; then |
190 |
eend 1 "Not running on a privileged domain. xencommons not started" |
191 |
return 1 |
192 |
fi |
193 |
|
194 |
handle_kernel_modules |
195 |
|
196 |
eend $? "Failed to start xencommons" |
197 |
} |
198 |
|
199 |
stop () { |
200 |
ebegin "Stopping xencommons" |
201 |
if ! is_privileged_domain; then |
202 |
eend 1 "Not running on a privileged domain. xencommons not started" |
203 |
return 1 |
204 |
fi |
205 |
|
206 |
handle_kernel_modules remove |
207 |
|
208 |
eend $? "Failed to stop xencommons" |
209 |
} |
210 |
|
211 |
|
212 |
|
213 |
|
214 |
1.1 app-emulation/xen-tools/files/xencommons.confd |
215 |
|
216 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/xen-tools/files/xencommons.confd?rev=1.1&view=markup |
217 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/xen-tools/files/xencommons.confd?rev=1.1&content-type=text/plain |
218 |
|
219 |
Index: xencommons.confd |
220 |
=================================================================== |
221 |
# /etc/conf.d/xenqemudev |
222 |
|
223 |
# To enable QEMU file backend, set to 'yes' |
224 |
XENQEMUDEV_FILE_BACKEND_ENABLE="" |
225 |
|
226 |
# Common options for xenqemudev |
227 |
XENQEMUDEV_OPTS="" |
228 |
|
229 |
|
230 |
|
231 |
1.1 app-emulation/xen-tools/files/xenqemudev.initd |
232 |
|
233 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/xen-tools/files/xenqemudev.initd?rev=1.1&view=markup |
234 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/xen-tools/files/xenqemudev.initd?rev=1.1&content-type=text/plain |
235 |
|
236 |
Index: xenqemudev.initd |
237 |
=================================================================== |
238 |
#!/sbin/runscript |
239 |
# Copyright 1999-2013 Gentoo Foundation |
240 |
# Distributed under the terms of the GNU General Public License v2 |
241 |
# $Header: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/files/xenqemudev.initd,v 1.1 2013/12/06 23:34:11 idella4 Exp $ |
242 |
|
243 |
extra_commands="status" |
244 |
|
245 |
depend() { |
246 |
need xend |
247 |
after dhcp |
248 |
} |
249 |
|
250 |
get_domname() { |
251 |
local name_from_file=$(sed -rn 's/^name\W*=\W*\"?([[:alnum:]_\.-]+)\"?\W*;?/\1/p' "${1}" | tail -n 1) |
252 |
|
253 |
if [ -z ${name_from_file} ] ; then |
254 |
basename "${1}" |
255 |
else |
256 |
echo ${name_from_file} |
257 |
fi |
258 |
} |
259 |
|
260 |
is_running() { |
261 |
/usr/sbin/xm list "${1}" >/dev/null 2>&1 |
262 |
} |
263 |
|
264 |
using_screen() { |
265 |
[ "${SCREEN}" = "yes" -o "${SCREEN}" = "YES" ] |
266 |
} |
267 |
|
268 |
set_screen_cmd() { |
269 |
screen_cmd="screen -c ${SCREENRC:-/dev/null} -q -r ${SCREEN_NAME:=xen} -X" |
270 |
} |
271 |
|
272 |
start() { |
273 |
set_screen_cmd |
274 |
|
275 |
einfo "Starting Xen domains from ${AUTODIR:=/etc/xen/auto}" |
276 |
if using_screen ; then |
277 |
ebegin "Creating screen session to hold domain consoles" |
278 |
( screen -c ${SCREENRC:-/dev/null} -d -m -S ${SCREEN_NAME} -t dom0 && sleep 3 \ |
279 |
&& ${screen_cmd} zombie dr \ |
280 |
&& logrotate -f /etc/xen/xen-consoles.logrotate \ |
281 |
&& ${screen_cmd} logfile /var/log/xen-consoles/%t.log \ |
282 |
&& ${screen_cmd} logfile flush ${SCREEN_LOG_INTERVAL:-1} \ |
283 |
&& ${screen_cmd} log on \ |
284 |
&& ${screen_cmd} deflog on ) >/dev/null |
285 |
if [ $? -ne 0 ] ; then |
286 |
eend 1 |
287 |
return 1 |
288 |
else |
289 |
eend |
290 |
fi |
291 |
fi |
292 |
# Create all domains with config files in AUTODIR. |
293 |
for dom in $(ls "${AUTODIR:=/etc/xen/auto}/"* 2>/dev/null | sort); do |
294 |
name=$(get_domname ${dom}) |
295 |
if ! is_running ${name} ; then |
296 |
ebegin " Starting domain ${name}" |
297 |
if using_screen ; then |
298 |
${screen_cmd} screen -t ${name} xm create ${dom} -c |
299 |
else |
300 |
xm create --quiet ${dom} |
301 |
fi |
302 |
eend $? |
303 |
else |
304 |
einfo " Not starting domain ${name} - already running" |
305 |
fi |
306 |
done |
307 |
} |
308 |
|
309 |
stop() { |
310 |
set_screen_cmd |
311 |
|
312 |
einfo "Shutting down Xen domains from ${AUTODIR:=/etc/xen/auto}" |
313 |
# Stop all domains with config files in AUTODIR. |
314 |
DOMAINS="$(ls "${AUTODIR:=/etc/xen/auto}/"* 2>/dev/null | sort -r)" |
315 |
|
316 |
if [[ "$PARALLEL_SHUTDOWN" == "yes" ]] ; then |
317 |
for dom in $DOMAINS ; do |
318 |
name=$(get_domname ${dom}) |
319 |
if is_running ${name} ; then |
320 |
ebegin " Asking domain ${name} to shutdown in the background..." |
321 |
xm shutdown --wait ${name} >/dev/null & |
322 |
else |
323 |
einfo " Not stopping domain ${name} - not running" |
324 |
fi |
325 |
done |
326 |
einfo " Waiting for shutdown of domains that are still running" |
327 |
wait |
328 |
eend $? |
329 |
else |
330 |
for dom in $DOMAINS ; do |
331 |
name=$(get_domname ${dom}) |
332 |
if is_running ${name} ; then |
333 |
ebegin " Waiting for domain ${name} to shutdown" |
334 |
xm shutdown --wait ${name} >/dev/null |
335 |
eend $? |
336 |
else |
337 |
einfo " Not stopping domain ${name} - not running" |
338 |
fi |
339 |
done |
340 |
fi |
341 |
if using_screen ; then |
342 |
if ${screen_cmd} sleep 0 >/dev/null 2>&1 ; then |
343 |
ebegin "Closing screen session ${SCREEN_NAME}" |
344 |
${screen_cmd} quit |
345 |
eend $? |
346 |
else |
347 |
eend 0 |
348 |
fi |
349 |
fi |
350 |
} |
351 |
|
352 |
status() { |
353 |
/usr/sbin/xm list |
354 |
} |