1 diff -uNr src.orig//etc/init.d/xe-linux-distribution src/etc/init.d/xe-linux-distribution
2 --- src.orig//etc/init.d/xe-linux-distribution 2010-05-20 13:19:02.000000000 +0200
3 +++ src/etc/init.d/xe-linux-distribution 2010-10-04 14:45:11.000000000 +0200
8 -if [ -f /etc/init.d/functions ] ; then
9 -. /etc/init.d/functions
18 - if [ $ret -eq 0 ] ; then
27 +. /etc/rc.d/functions
29 XE_LINUX_DISTRIBUTION=/usr/sbin/xe-linux-distribution
30 XE_LINUX_DISTRIBUTION_CACHE=/var/cache/xe-linux-distribution
35 + if [ -e /proc/xen/capabilities ] && grep -q control_d /proc/xen/capabilities ; then
36 + # Do not want daemon in domain 0
40 + stat_busy "Detecting Linux distribution version"
41 + ${XE_LINUX_DISTRIBUTION} ${XE_LINUX_DISTRIBUTION_CACHE}
42 + if [ $? -gt 0 ]; then
48 if [ ! -e /proc/xen/xenbus ] ; then
49 if [ ! -d /proc/xen ] ; then
50 - action $"Mounting xenfs on /proc/xen:" /bin/false
51 + stat_busy "Mounting xenfs on /proc/xen"
52 echo "Could not find /proc/xen directory."
53 echo "You need a post 2.6.29-rc1 kernel with CONFIG_XEN_COMPAT_XENFS=y and CONFIG_XENFS=y|m"
57 # This is needed post 2.6.29-rc1 when /proc/xen support was pushed upstream as a xen filesystem
58 - action $"Mounting xenfs on /proc/xen:" mount -t xenfs none /proc/xen
59 + stat_busy "Mounting xenfs on /proc/xen"
60 + mount -t xenfs none /proc/xen
61 + if [ $? -gt 0 ]; then
69 - if [ -e /proc/xen/capabilities ] && grep -q control_d /proc/xen/capabilities ; then
70 - # Do not want daemon in domain 0
74 - action $"Detecting Linux distribution version:" \
75 - ${XE_LINUX_DISTRIBUTION} ${XE_LINUX_DISTRIBUTION_CACHE}
77 - action $"Starting xe daemon: " /bin/true
78 + stat_busy "Starting xe daemon"
79 mkdir -p $(dirname ${XE_DAEMON_PIDFILE})
80 # This is equivalent to daemon() in C
81 ( exec &>/dev/null ; ${XE_DAEMON} -p ${XE_DAEMON_PIDFILE} & )
82 + if [ $? -gt 0 ]; then
85 + add_daemon xe-linux-distribution
92 - action $"Stopping xe daemon: " kill -TERM $(cat ${XE_DAEMON_PIDFILE})
93 + stat_busy "Stopping xe daemon"
94 + killall $(basename ${XE_DAEMON}) -TERM
95 + if [ $? -gt 0 ]; then
98 + rm_daemon xe-linux-distribution
103 # fail silently if not running xen
108 - force-reload|restart)
113 diff -uNr src.orig//usr/sbin/xe-linux-distribution src/usr/sbin/xe-linux-distribution
114 --- src.orig//usr/sbin/xe-linux-distribution 2010-05-20 13:19:02.000000000 +0200
115 +++ src/usr/sbin/xe-linux-distribution 2010-10-04 14:44:37.000000000 +0200
120 +identify_archlinux()
122 + local archlinux_version="$1"
126 + if [ ! -f "${archlinux_version}" ] ; then
130 + eval $(LC_ALL=C pacman -Qi initscripts |grep Version |sed "s/^.*: //" | \
131 + awk -F. '{print "major="$1 ; print "minor="$2 ; exit 0 }' )
132 + write_to_output "archlinux" "${major}" "${minor}" "Arch Linux ${major}.${minor}"
138 local debian_version="$1"
140 identify_sles /etc/SuSE-release && exit 0
141 identify_lsb lsb_release && exit 0
142 identify_debian /etc/debian_version && exit 0
143 + identify_archlinux /etc/arch-release && exit 0
145 if [ $# -eq 1 ] ; then