aboutsummaryrefslogtreecommitdiffstats
path: root/main/xen/xendomains.initd
diff options
context:
space:
mode:
Diffstat (limited to 'main/xen/xendomains.initd')
-rwxr-xr-x[-rw-r--r--]main/xen/xendomains.initd15
1 files changed, 15 insertions, 0 deletions
diff --git a/main/xen/xendomains.initd b/main/xen/xendomains.initd
index 63d35fc714..c791e3e585 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 \