diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2012-02-12 10:44:07 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2012-02-12 10:50:12 +0000 |
commit | 97935b308484879fd7117fcaf46cffa84552caaf (patch) | |
tree | e593c3271f81f72eb3f2f801a13fd4852e60e63a /main/xen/xend.initd | |
parent | cd46eba6f617f9d99d6485c14d2375fb4bdd68ca (diff) | |
download | aports-97935b308484879fd7117fcaf46cffa84552caaf.tar.bz2 aports-97935b308484879fd7117fcaf46cffa84552caaf.tar.xz |
main/xen: upgrade to 4.1.2
Diffstat (limited to 'main/xen/xend.initd')
-rw-r--r-- | main/xen/xend.initd | 39 |
1 files changed, 27 insertions, 12 deletions
diff --git a/main/xen/xend.initd b/main/xen/xend.initd index ee26c3f331..398ecd86b9 100644 --- a/main/xen/xend.initd +++ b/main/xen/xend.initd @@ -1,38 +1,53 @@ #!/sbin/runscript depend() { - need net xencommons - before xendomains sshd ntp-client ntpd nfs nfsmount rsyncd portmap dhcp + need xencommons + before xendomains } -is_privileged_domain() { - grep -qsE '^control_d$' /proc/xen/capabilities - return $? +await_daemons_up() { + i=1 + rets=10 + /usr/sbin/xend status + while [ $? -ne 0 -a $i -lt $rets ]; do + sleep 1 + i=$(($i + 1)) + /usr/sbin/xend status + done } start() { - if is_privileged_domain ; then - ebegin "Starting Xen daemons" - /usr/sbin/xend start - eend $? + ebegin "Starting Xen daemons" + if [ -z "`ps xenconsoled -o pid=`" ]; then + eend 1 + echo "xencommons should be started first." + exit 1 + fi + mkdir -p /var/lock + if [ -d /var/lock/subsys ]; then + touch /var/lock/subsys/xend else - eerror "Can't start xend - not a privileged domain" - return 1 + touch /var/lock/xend fi + /usr/sbin/xend start + await_daemons_up + eend $? } stop() { ebegin "Stopping Xen control daemon" /usr/sbin/xend stop + rm -f /var/lock/subsys/xend /var/lock/xend eend $? } restart() { ebegin "Restarting Xen control daemon" /usr/sbin/xend restart + await_daemons_up eend $? } status() { - is_privileged_domain && /usr/sbin/xend status + /usr/sbin/xend status } |