app-emulation/xen-tools: use xen-init-dom0
authorTomas Mozes <hydrapolic@gmail.com>
Thu, 12 Oct 2017 08:07:40 +0000 (10:07 +0200)
committerYixun Lan <dlan@gentoo.org>
Fri, 13 Oct 2017 08:04:28 +0000 (16:04 +0800)
Gentoo-Bug: 634042
Package-Manager: Portage-2.3.11, Repoman-2.3.3

Closes: https://github.com/gentoo/gentoo/pull/5925
Signed-off-by: Yixun Lan <dlan@gentoo.org>
app-emulation/xen-tools/files/xenstored.initd-r1 [new file with mode: 0644]
app-emulation/xen-tools/xen-tools-4.8.2-r1.ebuild

diff --git a/app-emulation/xen-tools/files/xenstored.initd-r1 b/app-emulation/xen-tools/files/xenstored.initd-r1
new file mode 100644 (file)
index 0000000..262535d
--- /dev/null
@@ -0,0 +1,42 @@
+#!/sbin/openrc-run
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+depend() {
+       before xendomains xend sshd ntp-client ntpd nfs nfsmount rsyncd portmap dhcp
+       need xencommons
+}
+
+xenstored_dir_check() {
+       # create dir dynamically
+       local i
+       for i in /var/lock/subsys /run/xen /run/xend/boot /run/xenstored; do
+               [ -x $i ] || mkdir -p $i
+       done
+}
+
+start() {
+       ebegin "Starting xenstored daemon"
+       xenstored_dir_check
+       start-stop-daemon --start --exec /usr/sbin/xenstored \
+               --pidfile /run/xenstored.pid \
+               -- --pid-file=/run/xenstored.pid \
+               $XENSTORED_OPTS
+       until xenstore-exists / || $((15 < ++i))
+       do
+               echo -n .
+               sleep 1
+       done
+       einfo "Setting domain0 name record"
+       /usr/libexec/xen/bin/xen-init-dom0
+
+       eend $*
+}
+
+stop() {
+       ebegin "Stopping xenstored daemon"
+       start-stop-daemon --stop --exec /usr/sbin/xenstored \
+               --pidfile /run/xenstored.pid
+       eend $?
+}
+
index 2a5886ec70ec633f51939551e2601d9e958a7c9b..3e35cd4c8eac3a26ad6dc421d08b3a58e12d21f6 100644 (file)
@@ -418,7 +418,7 @@ src_install() {
        newconfd "${FILESDIR}"/xenstored.confd xenstored
        newconfd "${FILESDIR}"/xenconsoled.confd xenconsoled
        newinitd "${FILESDIR}"/xendomains.initd-r2 xendomains
-       newinitd "${FILESDIR}"/xenstored.initd xenstored
+       newinitd "${FILESDIR}"/xenstored.initd-r1 xenstored
        newinitd "${FILESDIR}"/xenconsoled.initd xenconsoled
        newinitd "${FILESDIR}"/xencommons.initd xencommons
        newconfd "${FILESDIR}"/xencommons.confd xencommons