[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [stage1-xen PATCH v2 06/11] build/fedora: Add `xen-4.9.0-runit/*` scripts



From: Rajiv M Ranganath <rajiv.ranganath@xxxxxxxxxxx>

Signed-off-by: Rajiv Ranganath <rajiv.ranganath@xxxxxxxxxxx>
---
 build/fedora/xen-4.9.0-runit/setup.sh              |   18 ++++++++++++++++
 build/fedora/xen-4.9.0-runit/teardown.sh           |   18 ++++++++++++++++
 .../xen-4.9.0-runit/xen-init-dom0-disk-backend/run |   11 ++++++++++
 build/fedora/xen-4.9.0-runit/xen-init-dom0/run     |    9 ++++++++
 build/fedora/xen-4.9.0-runit/xenconsoled/run       |   13 +++++++++++
 build/fedora/xen-4.9.0-runit/xenstored/run         |   23 ++++++++++++++++++++
 6 files changed, 92 insertions(+)
 create mode 100755 build/fedora/xen-4.9.0-runit/setup.sh
 create mode 100755 build/fedora/xen-4.9.0-runit/teardown.sh
 create mode 100755 build/fedora/xen-4.9.0-runit/xen-init-dom0-disk-backend/run
 create mode 100755 build/fedora/xen-4.9.0-runit/xen-init-dom0/run
 create mode 100755 build/fedora/xen-4.9.0-runit/xenconsoled/run
 create mode 100755 build/fedora/xen-4.9.0-runit/xenstored/run

diff --git a/build/fedora/xen-4.9.0-runit/setup.sh 
b/build/fedora/xen-4.9.0-runit/setup.sh
new file mode 100755
index 0000000..935d332
--- /dev/null
+++ b/build/fedora/xen-4.9.0-runit/setup.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+set -e
+
+# runit RPM creates `/etc/service` directory
+if [ ! -d "/etc/service" ]; then
+    echo "/etc/service directory not found. Please install runit RPM."
+    exit 1
+fi
+
+runit_services="xenconsoled xen-init-dom0 xen-init-dom0-disk-backend xenstored"
+
+for service in $runit_services; do
+    ln -sf /opt/xen-4.9.0-runit/$service /etc/service/$service
+done
+
+echo "Successfully created symlinks in /etc/service directory."
+exit 0
diff --git a/build/fedora/xen-4.9.0-runit/teardown.sh 
b/build/fedora/xen-4.9.0-runit/teardown.sh
new file mode 100755
index 0000000..d333807
--- /dev/null
+++ b/build/fedora/xen-4.9.0-runit/teardown.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+set -e
+
+# runit RPM creates `/etc/service` directory
+if [ ! -d "/etc/service" ]; then
+    echo "/etc/service directory not found."
+    exit 1
+fi
+
+runit_services="xenconsoled xen-init-dom0 xen-init-dom0-disk-backend xenstored"
+
+for service in $runit_services; do
+    rm -f /etc/service/$service
+done
+
+echo "Successfully deleted symlinks in /etc/service directory."
+exit 0
diff --git a/build/fedora/xen-4.9.0-runit/xen-init-dom0-disk-backend/run 
b/build/fedora/xen-4.9.0-runit/xen-init-dom0-disk-backend/run
new file mode 100755
index 0000000..a59660c
--- /dev/null
+++ b/build/fedora/xen-4.9.0-runit/xen-init-dom0-disk-backend/run
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+set -e
+
+sv check xenstored >/dev/null || exit 1
+sv check xenconsoled >/dev/null || exit 1
+
+# In case of failure, allow user to run teardown script
+sleep 5s
+
+exec /opt/xen-4.9.0/lib/xen/bin/qemu-system-i386 -xen-domid 0 -xen-attach 
-name dom0 -nographic -M xenpv -monitor /dev/null -serial /dev/null -parallel 
/dev/null -nodefaults -no-user-config
diff --git a/build/fedora/xen-4.9.0-runit/xen-init-dom0/run 
b/build/fedora/xen-4.9.0-runit/xen-init-dom0/run
new file mode 100755
index 0000000..3b98091
--- /dev/null
+++ b/build/fedora/xen-4.9.0-runit/xen-init-dom0/run
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+set -e
+
+sv check xenstored >/dev/null || exit 1
+
+/opt/xen-4.9.0/lib/xen/bin/xen-init-dom0
+
+exec chpst -b xen-init-dom0 runit-pause
diff --git a/build/fedora/xen-4.9.0-runit/xenconsoled/run 
b/build/fedora/xen-4.9.0-runit/xenconsoled/run
new file mode 100755
index 0000000..a1c9a2c
--- /dev/null
+++ b/build/fedora/xen-4.9.0-runit/xenconsoled/run
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+set -e
+
+sv check xen-init-dom0 >/dev/null || exit 1
+
+[ ! -d /var/log/xen/console ] && mkdir -p /var/log/xen/console
+
+# In case of failure, allow user to run teardown script
+sleep 5s
+
+# --log=[none|guest|hv|all]
+exec /opt/xen-4.9.0/sbin/xenconsoled -i --log=none
diff --git a/build/fedora/xen-4.9.0-runit/xenstored/run 
b/build/fedora/xen-4.9.0-runit/xenstored/run
new file mode 100755
index 0000000..e49eb64
--- /dev/null
+++ b/build/fedora/xen-4.9.0-runit/xenstored/run
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+set -e
+
+[ ! -d /var/run/xen ] && mkdir -p /var/run/xen
+[ ! -d /var/run/xenstored ] && mkdir -p /var/run/xenstored
+[ ! -d /var/log/xen ] && mkdir -p /var/log/xen
+[ ! -d /var/lib/xen ] && mkdir -p /var/lib/xen
+[ ! -d /var/lib/xen/dump ] && mkdir -p /var/lib/xen/dump
+[ ! -d /var/lib/xen/xenpaging ] && mkdir -p /var/lib/xen/paging
+[ ! -d /var/lib/xenstored ] && mkdir -p /var/lib/xenstored
+modprobe -q xen-evtchn || exit 1
+modprobe -q xen-gntdev || exit 1
+modprobe -q xen-gntalloc || exit 1
+mountpoint -q /proc/xen || mount -t xenfs xenfs /proc/xen
+mountpoint -q /var/lib/xenstored || mount -t tmpfs xenstored /var/lib/xenstored
+grep -q "control_d" /proc/xen/capabilities || exit 1
+
+# In case of failure, allow user to run teardown script
+sleep 5s
+
+# Use `--trace-file /var/log/xen/xenstored-trace.log` for logs
+exec /opt/xen-4.9.0/sbin/xenstored --no-fork


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.