Commit d3bebbe0 authored by Natanael Copa's avatar Natanael Copa
Browse files

main/xen: fix xendomains init script to wait for screen

We need wait til the detatched screen has created the connection
sockets before trying to set the opts to it.

fixes #1181
(cherry picked from commit e247ca04)
parent 76529814
......@@ -3,7 +3,7 @@
# Maintainer: William Pitcock <nenolod@dereferenced.org>
pkgname=xen
pkgver=4.1.2
pkgrel=10
pkgrel=11
pkgdesc="Xen hypervisor"
url="http://www.xen.org/"
arch="x86 x86_64"
......@@ -137,6 +137,6 @@ ed262f15fb880badb53575539468646c xenconsoled.initd
ec2252c72050d7d5870a3a629b873ba6 xenconsoled.confd
89c936ddf327a3a78eaee33835880517 xend.initd
9261ad0f285836c1b0ea07f306e4586e xend.confd
6ce7f3069862ad23e3e1d908bb2b7987 xendomains.initd
9cc0883d472987038fd464a7e28372e3 xendomains.initd
f3162b7c261bcaf49a67bd41d987df84 xendomains.confd
9df68ac65dc3f372f5d61183abdc83ff xen-consoles.logrotate"
......@@ -29,9 +29,23 @@ using_screen() {
}
set_screen_cmd() {
export SCREENDIR=/var/run/xen-screens
checkpath --directory --mode 700 "$SCREENDIR"
screen_cmd="screen -c ${SCREENRC:-/dev/null} -q -r ${SCREEN_NAME:=xen} -X"
}
dir_is_empty() {
local dir=$1
set -- "$dir"/*
test "$1" = "$dir/*"
}
wait_screen() {
while dir_is_empty "$SCREENDIR"; do
sleep 0.1
done
}
start() {
set_screen_cmd
......@@ -39,6 +53,7 @@ start() {
if using_screen ; then
ebegin "Creating screen session to hold domain consoles"
( screen -c ${SCREENRC:-/dev/null} -d -m -S ${SCREEN_NAME} -t dom0 \
&& wait_screen \
&& ${screen_cmd} zombie dr \
&& logrotate -f /etc/xen/xen-consoles.logrotate \
&& ${screen_cmd} logfile /var/log/xen-consoles/%t.log \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment