summaryrefslogtreecommitdiffstats
path: root/main/xen
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2012-06-21 13:33:56 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2012-06-21 13:33:56 +0000
commite247ca0455a53e070f24b72688e6b6aafbdd9a11 (patch)
tree357250684830b63a472e0249a3bfc83593854b09 /main/xen
parent24866b94daf588f93425cf9470439cbca8cde332 (diff)
downloadaports-e247ca0455a53e070f24b72688e6b6aafbdd9a11.tar.bz2
aports-e247ca0455a53e070f24b72688e6b6aafbdd9a11.tar.xz
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. ref #1181
Diffstat (limited to 'main/xen')
-rw-r--r--main/xen/APKBUILD4
-rwxr-xr-x[-rw-r--r--]main/xen/xendomains.initd15
2 files changed, 17 insertions, 2 deletions
diff --git a/main/xen/APKBUILD b/main/xen/APKBUILD
index 28dc25209..8b6f99802 100644
--- a/main/xen/APKBUILD
+++ b/main/xen/APKBUILD
@@ -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"
diff --git a/main/xen/xendomains.initd b/main/xen/xendomains.initd
index 63d35fc71..c791e3e58 100644..100755
--- a/main/xen/xendomains.initd
+++ b/main/xen/xendomains.initd
@@ -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 \