blob: ad0486e52fefcbd85a4a7657dbc7b2fbda516a72 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
#!/sbin/runscript
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-emulation/xen/files/xend-init,v 1.3 2005/10/08 12:32:33 chrb Exp $
opts="start stop status restart"
depend() {
need net
before xendomain sshd ntpd nfs nfsmount rsyncd portmap
}
await_daemons_up() {
for ((i=0; i<5; i++)); do
sleep 1
/usr/sbin/xend status && return 0
done
return 1
}
start() {
ebegin "Starting Xen control daemon"
/usr/sbin/xend start
/usr/sbin/xend status || await_daemons_up
eend $?
}
stop() {
if [ "$(xm list | wc -l)" -gt 2 ]; then
ebegin " Stopping all domains"
/usr/sbin/xm shutdown --all --wait >/dev/null
eend $?
fi
ebegin "Stopping Xen control daemon"
/usr/sbin/xend stop
eend $?
}
status() {
/usr/sbin/xend status
}
|