All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bruce Edge <bruce.edge@gmail.com>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: Olaf Hering <olaf@aepfle.de>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [patch] Xen build - Debian vs Redhat layout patch options
Date: Fri, 17 Sep 2010 11:13:43 -0700	[thread overview]
Message-ID: <AANLkTink2YkVEPLzmfUtR-6oH8eT3Lke+NqED9rjN_dN@mail.gmail.com> (raw)
In-Reply-To: <19603.43748.648476.611237@mariner.uk.xensource.com>

[-- Attachment #1: Type: text/plain, Size: 12666 bytes --]

On Fri, Sep 17, 2010 at 10:52 AM, Ian Jackson <Ian.Jackson@eu.citrix.com> wrote:
> Bruce Edge writes ("Re: [Xen-devel] [patch] Xen build - Debian vs Redhat layout patch options"):
>> Yes and no. For building one only needs to add these in the env or
>> Config.mk, but for runtime, xen checks each location in turn and for
>> non-standard locations checks need to be added. eg:
>
> Ah, I see what you mean.  But I think your grep cannot be reliable
> anyway because we cannot anticipate all the ways a distro may be
> weird.
>
> If for some distro /etc/default needs to be changed to a third
> possibility then yes they'll have to grep for /etc/default; but if
> /etc is renamed /flibble then they'll have to grep for /flibble.  I
> expect most distro packages and admins will know about these
> idiosyncracies.
>
> But write what you like; it's only a doc comment :-).
>
> Ian.
>

All comments addressed and fixed.

-Bruce

=============== cut ===============

See docs/misc/distro_mapping.txt for more details.

Author: Bruce Edge <bruce.edge@gmail.com>

Signed-off-by: Bruce Edge <bruce.edge@gmail.com>

Index: xen-unstable.hg/config/StdGNU.mk
===================================================================
--- xen-unstable.hg.orig/config/StdGNU.mk       2010-09-17
10:40:05.000000000 -0700
+++ xen-unstable.hg/config/StdGNU.mk    2010-09-17 10:54:29.000000000 -0700
@@ -49,7 +49,7 @@
 CONFIG_DIR = $(PREFIX)/etc
 endif

-SYSCONFIG_DIR = $(CONFIG_DIR)/sysconfig
+SYSCONFIG_DIR = $(CONFIG_DIR)/$(CONFIG_LEAF_DIR)

 XEN_CONFIG_DIR = $(CONFIG_DIR)/xen
 XEN_SCRIPT_DIR = $(XEN_CONFIG_DIR)/scripts
Index: xen-unstable.hg/Makefile
===================================================================
--- xen-unstable.hg.orig/Makefile       2010-09-17 10:40:05.000000000 -0700
+++ xen-unstable.hg/Makefile    2010-09-17 10:54:29.000000000 -0700
@@ -203,7 +203,7 @@
        rm -f  $(D)$(CONFIG_DIR)/udev/xen-backend.rules
        rm -f  $(D)$(CONFIG_DIR)/udev/rules.d/xend.rules
        rm -f  $(D)$(CONFIG_DIR)/udev/xend.rules
-       rm -f  $(D)$(CONFIG_DIR)/sysconfig/xendomains
+       rm -f  $(D)$(SYSCONFIG_DIR)/xendomains
        rm -rf $(D)/var/run/xen* $(D)/var/lib/xen*
        rm -rf $(D)/boot/*xen*
        rm -rf $(D)/lib/modules/*xen*
Index: xen-unstable.hg/docs/misc/distro_mapping.txt
===================================================================
--- /dev/null   1970-01-01 00:00:00.000000000 +0000
+++ xen-unstable.hg/docs/misc/distro_mapping.txt        2010-09-17
11:03:23.000000000 -0700
@@ -0,0 +1,27 @@
+With directory layout differences between Red Hat, Debian, Suse and
+other distros one needs to set the variables for the elements below
+
+-----------------+------------------+---------------+----------------+
+                 | RedHat (default) |  Debian       |  Suse          |
+-----------------+------------------+---------------+----------------+
+CONFIG_LEAF_DIR  | sysconfig        | default       | sysconfig      |
+SUBSYS_DIR       | /var/run/subsys  | /var/run      | /var/run       |
+INITD_DIR        | /etc/rc.d/init.d | /etc/init.d   | /etc/init.d    |
+-----------------+------------------+---------------+----------------+
+
+The build currently defaults to the elements used by Red Hat.
+For others, these env variables must be set in the shell env
+or modified in Config.mk before running make.
+
+This mechanism sets the location that files are installed to, but does
+not change the code itself. Scripts that refer to files affected by these
+directories must check each possible location at run time.
+
+To add support for new distributions that don't use the above locations,
+one must grep for the above elements and add appropriate checks.
+
+For example if a new distro uses /etc/bork as it's config dir, It's not
+sufficient to set CONFIG_LEAF_DIR=bork, one must also add tests for the
+existance of the bork dir in every context where config files are read.
+
+
Index: xen-unstable.hg/tools/xenballoon/xenballoond.init
===================================================================
--- xen-unstable.hg.orig/tools/xenballoon/xenballoond.init
2010-09-17 10:40:05.000000000 -0700
+++ xen-unstable.hg/tools/xenballoon/xenballoond.init   2010-09-17
10:54:29.000000000 -0700
@@ -29,6 +29,8 @@

 if [ -f /etc/sysconfig/xenballoon.conf ]; then
        . /etc/sysconfig/xenballoon.conf
+elif [ -f /etc/default/xenballoon.conf ]; then
+       . /etc/default/xenballoon.conf
 fi

 # Check that balloon driver is present
Index: xen-unstable.hg/tools/xenballoon/xenballoond
===================================================================
--- xen-unstable.hg.orig/tools/xenballoon/xenballoond   2010-09-17
10:40:05.000000000 -0700
+++ xen-unstable.hg/tools/xenballoon/xenballoond        2010-09-17
10:54:29.000000000 -0700
@@ -21,7 +21,7 @@
 # If xenbus is running and the /usr/bin/xenstore-* tools are installed,
 # "xenbus is enabled".
 #
-# Parameters are documented in /etc/sysconfig/xenballoon.conf. Although
+# Parameters are documented in <SYSCONFIG>/xenballoon.conf. Although
 # some are not used with directed ballooning, all must be set properly.
 # If xenbus is enabled, some of these parameters may be overridden by values
 # set by domain0 via xenbus.
@@ -237,7 +237,12 @@
 fi
 preswapnow=0

-. /etc/sysconfig/xenballoon.conf
+# See docs/misc/distro_mapping.txt
+if [ -f /etc/sysconfig/xenballoon.conf ]; then
+       . /etc/sysconfig/xenballoon.conf
+elif [ -f /etc/default/xenballoon.conf ]; then
+       . /etc/default/xenballoon.conf
+fi

 while true;
 do
Index: xen-unstable.hg/tools/xenballoon/xenballoond.README
===================================================================
--- xen-unstable.hg.orig/tools/xenballoon/xenballoond.README
2010-09-17 10:40:05.000000000 -0700
+++ xen-unstable.hg/tools/xenballoon/xenballoond.README 2010-09-17
11:04:19.000000000 -0700
@@ -56,16 +56,20 @@
     be installed.  Binaries can be obtained, for example, by building
     xen-vvv.gz/tools in a guest-binary-compatible development tree

-Instructions to install/deploy xenballoond (in Redhat-based system):
+Instructions to install/deploy xenballoond:
+  (see docs/misc/distro_mapping.txt for SYSCONFIG and INITD_DIR definitions)
 - in each guest:
   - ensure pre-requisites are met (see above)
-  - place xenballoon.conf in /etc/sysconfig
+  - place xenballoon.conf in <SYSCONFIG>
   - place xenballoond in /usr/sbin
-  - copy xenballoond.init to /etc/rc.d/init.d/xenballoond (note file rename)
-  - edit /etc/sysconfig/xenballoond.conf as desired (especially note that
+  - copy xenballoond.init to <INITD_DIR>/xenballoond (note file rename)
+  - edit <SYSCONFIG>/xenballoond.conf as desired (especially note that
     selfballooning defaults as off)
   - start xenballoond with "service xenballoond start", and/or configure
-    xenballoond to start at init (e.g. "chkconfig xenballoond on")
+    xenballoond to start at init
+        (Red Hat e.g. "chkconfig xenballoond on")
+        (Debian e.g. " update-rc.d xenballoond defaults")
+        (Suse e.g. " insserv xenballoond")
 - in domain0:
   - if monitoring is desired, xenballoon-monitor may be installed in /usr/sbin
 - note that certain xenballoond.conf variables may be overridden by domain0
@@ -73,7 +77,6 @@
   xenballoond.conf

 TODO:
-080630 modifications to support SUSE-based and debian-based guests
 080630 domain0 ballooning policy module
 080630 experiment with more aggressive (optionally) memory minimum targets
 080630 BUG: xenballoond doesn't properly record the fact that it's running;
Index: xen-unstable.hg/tools/hotplug/Linux/init.d/xendomains
===================================================================
--- xen-unstable.hg.orig/tools/hotplug/Linux/init.d/xendomains
2010-09-17 10:40:05.000000000 -0700
+++ xen-unstable.hg/tools/hotplug/Linux/init.d/xendomains
2010-09-17 10:54:29.000000000 -0700
@@ -46,8 +46,18 @@
        exit 0
 fi

-LOCKFILE=/var/lock/subsys/xendomains
-XENDOM_CONFIG=/etc/sysconfig/xendomains
+# See docs/misc/distro_mapping.txt
+if [ -d /var/lock/subsys ]; then
+       LOCKFILE=/var/lock/subsys/xendomains
+else
+       LOCKFILE=/var/lock/xendomains
+fi
+
+if [ -d /etc/sysconfig ]; then
+       XENDOM_CONFIG=/etc/sysconfig/xendomains
+else
+       XENDOM_CONFIG=/etc/default/xendomains
+fi

 test -r $XENDOM_CONFIG || { echo "$XENDOM_CONFIG not existing";
        if [ "$1" = "stop" ]; then exit 0;
Index: xen-unstable.hg/tools/hotplug/Linux/init.d/xend
===================================================================
--- xen-unstable.hg.orig/tools/hotplug/Linux/init.d/xend
2010-09-17 10:40:05.000000000 -0700
+++ xen-unstable.hg/tools/hotplug/Linux/init.d/xend     2010-09-17
10:54:29.000000000 -0700
@@ -40,14 +40,20 @@
                echo "xencommons should be started first."
                exit 1
        fi
-       mkdir -p /var/lock/subsys
-       touch /var/lock/subsys/xend
+       # mkdir shouldn't be needed as most distros have this already
created. Default to using subsys.
+       # See docs/misc/distro_mapping.txt
+       mkdir -p /var/lock
+       if [ -d /var/lock/subsys ] ; then
+               touch /var/lock/subsys/xend
+       else
+               touch /var/lock/xend
+       fi
        xend start
        await_daemons_up
        ;;
   stop)
        xend stop
-       rm -f /var/lock/subsys/xend
+       rm -f /var/lock/subsys/xend /var/lock/xend
        ;;
   status)
        xend status
Index: xen-unstable.hg/tools/hotplug/Linux/Makefile
===================================================================
--- xen-unstable.hg.orig/tools/hotplug/Linux/Makefile   2010-09-17
10:40:05.000000000 -0700
+++ xen-unstable.hg/tools/hotplug/Linux/Makefile        2010-09-17
10:54:29.000000000 -0700
@@ -62,16 +62,17 @@
 .PHONY: install
 install: all install-initd install-scripts $(HOTPLUGS)

+# See docs/misc/distro_mapping.txt for INITD_DIR location
 .PHONY: install-initd
 install-initd:
-       [ -d $(DESTDIR)$(CONFIG_DIR)/init.d ] || $(INSTALL_DIR)
$(DESTDIR)$(CONFIG_DIR)/init.d
+       [ -d $(DESTDIR)$(INITD_DIR) ] || $(INSTALL_DIR) $(DESTDIR)$(INITD_DIR)
        [ -d $(DESTDIR)$(SYSCONFIG_DIR) ] || $(INSTALL_DIR)
$(DESTDIR)$(SYSCONFIG_DIR)
-       $(INSTALL_PROG) $(XEND_INITD) $(DESTDIR)$(CONFIG_DIR)/init.d
-       $(INSTALL_PROG) $(XENDOMAINS_INITD) $(DESTDIR)$(CONFIG_DIR)/init.d
+       $(INSTALL_PROG) $(XEND_INITD) $(DESTDIR)$(INITD_DIR)
+       $(INSTALL_PROG) $(XENDOMAINS_INITD) $(DESTDIR)$(INITD_DIR)
        $(INSTALL_PROG) $(XENDOMAINS_SYSCONFIG)
$(DESTDIR)$(SYSCONFIG_DIR)/xendomains
-       $(INSTALL_PROG) $(XENCOMMONS_INITD) $(DESTDIR)$(CONFIG_DIR)/init.d
+       $(INSTALL_PROG) $(XENCOMMONS_INITD) $(DESTDIR)$(INITD_DIR)
        $(INSTALL_PROG) $(XENCOMMONS_SYSCONFIG)
$(DESTDIR)$(SYSCONFIG_DIR)/xencommons
-       $(INSTALL_PROG) init.d/xen-watchdog $(DESTDIR)$(CONFIG_DIR)/init.d
+       $(INSTALL_PROG) init.d/xen-watchdog $(DESTDIR)$(INITD_DIR)

 .PHONY: install-scripts
 install-scripts:
Index: xen-unstable.hg/tools/hotplug/Linux/init.d/xen-watchdog
===================================================================
--- xen-unstable.hg.orig/tools/hotplug/Linux/init.d/xen-watchdog
 2010-09-17 10:40:05.000000000 -0700
+++ xen-unstable.hg/tools/hotplug/Linux/init.d/xen-watchdog
2010-09-17 10:54:29.000000000 -0700
@@ -18,7 +18,24 @@
 #

 # Source function library.
-. /etc/init.d/functions
+if [ -e  /etc/init.d/functions ] ; then
+    . /etc/init.d/functions
+elif [ -e /lib/lsb/init-functions ] ; then
+    . /lib/lsb/init-functions
+    success () {
+        log_success_msg $*
+    }
+    failure () {
+        log_failure_msg $*
+    }
+else
+    success () {
+        echo $*
+    }
+    failure () {
+        echo $*
+    }
+fi

 start() {
        local r
Index: xen-unstable.hg/Config.mk
===================================================================
--- xen-unstable.hg.orig/Config.mk      2010-09-17 10:40:05.000000000 -0700
+++ xen-unstable.hg/Config.mk   2010-09-17 10:54:29.000000000 -0700
@@ -31,6 +31,12 @@
 MANDIR      ?= $(SHAREDIR)/man
 BASH_COMPLETION_DIR ?= $(CONFIG_DIR)/bash_completion.d

+# These are the Red Hat settings.
+# See distro_mapping.txt for other options
+CONFIG_LEAF_DIR ?= sysconfig
+SUBSYS_DIR ?= /var/run/subsys
+INITD_DIR ?= /etc/rc.d/init.d
+
 ifneq ($(EXTRA_PREFIX),)
 EXTRA_INCLUDES += $(EXTRA_PREFIX)/include
 EXTRA_LIB += $(EXTRA_PREFIX)/$(LIBLEAFDIR)

[-- Attachment #2: sysconfig-alias.patch --]
[-- Type: text/x-patch, Size: 10999 bytes --]

See docs/misc/distro_mapping.txt for more details.

Author: Bruce Edge <bruce.edge@gmail.com>

Signed-off-by: Bruce Edge <bruce.edge@gmail.com>

Index: xen-unstable.hg/config/StdGNU.mk
===================================================================
--- xen-unstable.hg.orig/config/StdGNU.mk	2010-09-17 10:40:05.000000000 -0700
+++ xen-unstable.hg/config/StdGNU.mk	2010-09-17 10:54:29.000000000 -0700
@@ -49,7 +49,7 @@
 CONFIG_DIR = $(PREFIX)/etc
 endif
 
-SYSCONFIG_DIR = $(CONFIG_DIR)/sysconfig
+SYSCONFIG_DIR = $(CONFIG_DIR)/$(CONFIG_LEAF_DIR)
 
 XEN_CONFIG_DIR = $(CONFIG_DIR)/xen
 XEN_SCRIPT_DIR = $(XEN_CONFIG_DIR)/scripts
Index: xen-unstable.hg/Makefile
===================================================================
--- xen-unstable.hg.orig/Makefile	2010-09-17 10:40:05.000000000 -0700
+++ xen-unstable.hg/Makefile	2010-09-17 10:54:29.000000000 -0700
@@ -203,7 +203,7 @@
 	rm -f  $(D)$(CONFIG_DIR)/udev/xen-backend.rules
 	rm -f  $(D)$(CONFIG_DIR)/udev/rules.d/xend.rules
 	rm -f  $(D)$(CONFIG_DIR)/udev/xend.rules
-	rm -f  $(D)$(CONFIG_DIR)/sysconfig/xendomains
+	rm -f  $(D)$(SYSCONFIG_DIR)/xendomains
 	rm -rf $(D)/var/run/xen* $(D)/var/lib/xen*
 	rm -rf $(D)/boot/*xen*
 	rm -rf $(D)/lib/modules/*xen*
Index: xen-unstable.hg/docs/misc/distro_mapping.txt
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ xen-unstable.hg/docs/misc/distro_mapping.txt	2010-09-17 11:03:23.000000000 -0700
@@ -0,0 +1,27 @@
+With directory layout differences between Red Hat, Debian, Suse and
+other distros one needs to set the variables for the elements below
+
+-----------------+------------------+---------------+----------------+
+                 | RedHat (default) |  Debian       |  Suse          |
+-----------------+------------------+---------------+----------------+
+CONFIG_LEAF_DIR  | sysconfig        | default       | sysconfig      |
+SUBSYS_DIR       | /var/run/subsys  | /var/run      | /var/run       |
+INITD_DIR        | /etc/rc.d/init.d | /etc/init.d   | /etc/init.d    |
+-----------------+------------------+---------------+----------------+
+
+The build currently defaults to the elements used by Red Hat.
+For others, these env variables must be set in the shell env
+or modified in Config.mk before running make.
+
+This mechanism sets the location that files are installed to, but does
+not change the code itself. Scripts that refer to files affected by these
+directories must check each possible location at run time.
+
+To add support for new distributions that don't use the above locations,
+one must grep for the above elements and add appropriate checks.
+
+For example if a new distro uses /etc/bork as it's config dir, It's not
+sufficient to set CONFIG_LEAF_DIR=bork, one must also add tests for the
+existance of the bork dir in every context where config files are read.
+
+
Index: xen-unstable.hg/tools/xenballoon/xenballoond.init
===================================================================
--- xen-unstable.hg.orig/tools/xenballoon/xenballoond.init	2010-09-17 10:40:05.000000000 -0700
+++ xen-unstable.hg/tools/xenballoon/xenballoond.init	2010-09-17 10:54:29.000000000 -0700
@@ -29,6 +29,8 @@
 
 if [ -f /etc/sysconfig/xenballoon.conf ]; then
 	. /etc/sysconfig/xenballoon.conf
+elif [ -f /etc/default/xenballoon.conf ]; then
+	. /etc/default/xenballoon.conf
 fi
 
 # Check that balloon driver is present
Index: xen-unstable.hg/tools/xenballoon/xenballoond
===================================================================
--- xen-unstable.hg.orig/tools/xenballoon/xenballoond	2010-09-17 10:40:05.000000000 -0700
+++ xen-unstable.hg/tools/xenballoon/xenballoond	2010-09-17 10:54:29.000000000 -0700
@@ -21,7 +21,7 @@
 # If xenbus is running and the /usr/bin/xenstore-* tools are installed,
 # "xenbus is enabled".
 #
-# Parameters are documented in /etc/sysconfig/xenballoon.conf. Although 
+# Parameters are documented in <SYSCONFIG>/xenballoon.conf. Although
 # some are not used with directed ballooning, all must be set properly.
 # If xenbus is enabled, some of these parameters may be overridden by values
 # set by domain0 via xenbus.
@@ -237,7 +237,12 @@
 fi
 preswapnow=0
 
-. /etc/sysconfig/xenballoon.conf
+# See docs/misc/distro_mapping.txt
+if [ -f /etc/sysconfig/xenballoon.conf ]; then
+	. /etc/sysconfig/xenballoon.conf
+elif [ -f /etc/default/xenballoon.conf ]; then
+	. /etc/default/xenballoon.conf
+fi
 
 while true;
 do
Index: xen-unstable.hg/tools/xenballoon/xenballoond.README
===================================================================
--- xen-unstable.hg.orig/tools/xenballoon/xenballoond.README	2010-09-17 10:40:05.000000000 -0700
+++ xen-unstable.hg/tools/xenballoon/xenballoond.README	2010-09-17 11:04:19.000000000 -0700
@@ -56,16 +56,20 @@
     be installed.  Binaries can be obtained, for example, by building
     xen-vvv.gz/tools in a guest-binary-compatible development tree
 
-Instructions to install/deploy xenballoond (in Redhat-based system):
+Instructions to install/deploy xenballoond:
+  (see docs/misc/distro_mapping.txt for SYSCONFIG and INITD_DIR definitions)
 - in each guest:
   - ensure pre-requisites are met (see above)
-  - place xenballoon.conf in /etc/sysconfig
+  - place xenballoon.conf in <SYSCONFIG>
   - place xenballoond in /usr/sbin
-  - copy xenballoond.init to /etc/rc.d/init.d/xenballoond (note file rename)
-  - edit /etc/sysconfig/xenballoond.conf as desired (especially note that
+  - copy xenballoond.init to <INITD_DIR>/xenballoond (note file rename)
+  - edit <SYSCONFIG>/xenballoond.conf as desired (especially note that
     selfballooning defaults as off)
   - start xenballoond with "service xenballoond start", and/or configure
-    xenballoond to start at init (e.g. "chkconfig xenballoond on")
+    xenballoond to start at init
+        (Red Hat e.g. "chkconfig xenballoond on")
+        (Debian e.g. " update-rc.d xenballoond defaults")
+        (Suse e.g. " insserv xenballoond")
 - in domain0:
   - if monitoring is desired, xenballoon-monitor may be installed in /usr/sbin
 - note that certain xenballoond.conf variables may be overridden by domain0
@@ -73,7 +77,6 @@
   xenballoond.conf
 
 TODO:
-080630 modifications to support SUSE-based and debian-based guests
 080630 domain0 ballooning policy module
 080630 experiment with more aggressive (optionally) memory minimum targets
 080630 BUG: xenballoond doesn't properly record the fact that it's running;
Index: xen-unstable.hg/tools/hotplug/Linux/init.d/xendomains
===================================================================
--- xen-unstable.hg.orig/tools/hotplug/Linux/init.d/xendomains	2010-09-17 10:40:05.000000000 -0700
+++ xen-unstable.hg/tools/hotplug/Linux/init.d/xendomains	2010-09-17 10:54:29.000000000 -0700
@@ -46,8 +46,18 @@
 	exit 0
 fi
 
-LOCKFILE=/var/lock/subsys/xendomains
-XENDOM_CONFIG=/etc/sysconfig/xendomains
+# See docs/misc/distro_mapping.txt
+if [ -d /var/lock/subsys ]; then
+	LOCKFILE=/var/lock/subsys/xendomains
+else
+	LOCKFILE=/var/lock/xendomains
+fi
+
+if [ -d /etc/sysconfig ]; then
+	XENDOM_CONFIG=/etc/sysconfig/xendomains
+else
+	XENDOM_CONFIG=/etc/default/xendomains
+fi
 
 test -r $XENDOM_CONFIG || { echo "$XENDOM_CONFIG not existing";
 	if [ "$1" = "stop" ]; then exit 0;
Index: xen-unstable.hg/tools/hotplug/Linux/init.d/xend
===================================================================
--- xen-unstable.hg.orig/tools/hotplug/Linux/init.d/xend	2010-09-17 10:40:05.000000000 -0700
+++ xen-unstable.hg/tools/hotplug/Linux/init.d/xend	2010-09-17 10:54:29.000000000 -0700
@@ -40,14 +40,20 @@
 		echo "xencommons should be started first."
 		exit 1
 	fi
-	mkdir -p /var/lock/subsys
-	touch /var/lock/subsys/xend
+	# mkdir shouldn't be needed as most distros have this already created. Default to using subsys.
+	# See docs/misc/distro_mapping.txt
+	mkdir -p /var/lock
+	if [ -d /var/lock/subsys ] ; then
+		touch /var/lock/subsys/xend
+	else
+		touch /var/lock/xend
+	fi
 	xend start
 	await_daemons_up
 	;;
   stop)
 	xend stop
-	rm -f /var/lock/subsys/xend
+	rm -f /var/lock/subsys/xend /var/lock/xend
 	;;
   status)
 	xend status
Index: xen-unstable.hg/tools/hotplug/Linux/Makefile
===================================================================
--- xen-unstable.hg.orig/tools/hotplug/Linux/Makefile	2010-09-17 10:40:05.000000000 -0700
+++ xen-unstable.hg/tools/hotplug/Linux/Makefile	2010-09-17 10:54:29.000000000 -0700
@@ -62,16 +62,17 @@
 .PHONY: install
 install: all install-initd install-scripts $(HOTPLUGS)
 
+# See docs/misc/distro_mapping.txt for INITD_DIR location
 .PHONY: install-initd
 install-initd:
-	[ -d $(DESTDIR)$(CONFIG_DIR)/init.d ] || $(INSTALL_DIR) $(DESTDIR)$(CONFIG_DIR)/init.d
+	[ -d $(DESTDIR)$(INITD_DIR) ] || $(INSTALL_DIR) $(DESTDIR)$(INITD_DIR)
 	[ -d $(DESTDIR)$(SYSCONFIG_DIR) ] || $(INSTALL_DIR) $(DESTDIR)$(SYSCONFIG_DIR)
-	$(INSTALL_PROG) $(XEND_INITD) $(DESTDIR)$(CONFIG_DIR)/init.d
-	$(INSTALL_PROG) $(XENDOMAINS_INITD) $(DESTDIR)$(CONFIG_DIR)/init.d
+	$(INSTALL_PROG) $(XEND_INITD) $(DESTDIR)$(INITD_DIR)
+	$(INSTALL_PROG) $(XENDOMAINS_INITD) $(DESTDIR)$(INITD_DIR)
 	$(INSTALL_PROG) $(XENDOMAINS_SYSCONFIG) $(DESTDIR)$(SYSCONFIG_DIR)/xendomains
-	$(INSTALL_PROG) $(XENCOMMONS_INITD) $(DESTDIR)$(CONFIG_DIR)/init.d
+	$(INSTALL_PROG) $(XENCOMMONS_INITD) $(DESTDIR)$(INITD_DIR)
 	$(INSTALL_PROG) $(XENCOMMONS_SYSCONFIG) $(DESTDIR)$(SYSCONFIG_DIR)/xencommons
-	$(INSTALL_PROG) init.d/xen-watchdog $(DESTDIR)$(CONFIG_DIR)/init.d
+	$(INSTALL_PROG) init.d/xen-watchdog $(DESTDIR)$(INITD_DIR)
 
 .PHONY: install-scripts
 install-scripts:
Index: xen-unstable.hg/tools/hotplug/Linux/init.d/xen-watchdog
===================================================================
--- xen-unstable.hg.orig/tools/hotplug/Linux/init.d/xen-watchdog	2010-09-17 10:40:05.000000000 -0700
+++ xen-unstable.hg/tools/hotplug/Linux/init.d/xen-watchdog	2010-09-17 10:54:29.000000000 -0700
@@ -18,7 +18,24 @@
 #
 
 # Source function library.
-. /etc/init.d/functions
+if [ -e  /etc/init.d/functions ] ; then
+    . /etc/init.d/functions
+elif [ -e /lib/lsb/init-functions ] ; then
+    . /lib/lsb/init-functions
+    success () {
+        log_success_msg $*
+    }
+    failure () {
+        log_failure_msg $*
+    }
+else
+    success () {
+        echo $*
+    }
+    failure () {
+        echo $*
+    }
+fi
 
 start() {
 	local r
Index: xen-unstable.hg/Config.mk
===================================================================
--- xen-unstable.hg.orig/Config.mk	2010-09-17 10:40:05.000000000 -0700
+++ xen-unstable.hg/Config.mk	2010-09-17 10:54:29.000000000 -0700
@@ -31,6 +31,12 @@
 MANDIR      ?= $(SHAREDIR)/man
 BASH_COMPLETION_DIR ?= $(CONFIG_DIR)/bash_completion.d
 
+# These are the Red Hat settings.
+# See distro_mapping.txt for other options
+CONFIG_LEAF_DIR ?= sysconfig
+SUBSYS_DIR ?= /var/run/subsys
+INITD_DIR ?= /etc/rc.d/init.d
+
 ifneq ($(EXTRA_PREFIX),)
 EXTRA_INCLUDES += $(EXTRA_PREFIX)/include
 EXTRA_LIB += $(EXTRA_PREFIX)/$(LIBLEAFDIR)

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

  reply	other threads:[~2010-09-17 18:13 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-07  0:07 Xen build - Debian vs Redhat layout patch options Bruce Edge
2010-07-07 11:19 ` Stefano Stabellini
2010-09-13 23:53   ` [patch] " Bruce Edge
2010-09-14  0:23     ` Mike Viau
2010-09-14  6:45     ` Sander Eikelenboom
2010-09-14 14:18       ` Bruce Edge
2010-09-14 14:31     ` Olaf Hering
2010-09-14 17:05     ` Ian Jackson
2010-09-14 17:13       ` Bruce Edge
2010-09-14 18:56       ` Bruce Edge
2010-09-15 10:03         ` Ian Jackson
2010-09-15 16:06           ` Bruce Edge
2010-09-15 16:16             ` Olaf Hering
2010-09-16 16:29             ` Ian Jackson
2010-09-16 18:52               ` Bruce Edge
2010-09-16 20:45                 ` Olaf Hering
2010-09-16 20:56                   ` Bruce Edge
2010-09-16 20:59                     ` Olaf Hering
2010-09-16 21:02                       ` Bruce Edge
2010-09-17 16:11                         ` Ian Jackson
2010-09-17 17:05                           ` Bruce Edge
2010-09-17 17:52                             ` Ian Jackson
2010-09-17 18:13                               ` Bruce Edge [this message]
2010-09-16 20:24               ` Dan Magenheimer
2010-09-16 20:34                 ` Dan Magenheimer
2010-09-17 15:01               ` [patch] Xen build - Debian vs Redhat layout patch options [and 1 more messages] Ian Jackson
     [not found]   ` <AANLkTim48T7Y3Pq0_nS1zZ5jWH_kXrS8JceWLf-yUOM6@mail.gmail.com>
2011-01-04 21:09     ` Xen build - Debian vs Redhat layout patch options user virtual
2011-01-06 15:02       ` Stefano Stabellini
2011-01-11 17:37       ` Ian Jackson
2011-01-20 13:45         ` user virtual
     [not found]           ` <AANLkTimCA_T1QsfCVfABtW8776Mkg3toBtmHYHgea56=@mail.gmail.com>
2011-01-19 22:34             ` xen-unstable: ImportError: No module named xen.xm chris
2011-01-20  8:38               ` Ian Campbell
2011-01-20 16:49                 ` [Xen-devel] " chris
2011-01-20 16:54                   ` Ian Campbell
2011-01-20 17:23                     ` chris
2011-01-20 17:38                       ` Ian Campbell
2011-01-21 18:20                         ` [Xen-users] " Mike Viau
2011-01-21 19:16                           ` Ian Jackson
2011-01-26 14:51                           ` Re: [Xen-devel] " Ian Jackson
2011-01-26 17:32                             ` Mike Viau
     [not found]                 ` <m2n.s.1PfxnK-153952@chiark.greenend.org.uk>
2011-01-20 18:19                   ` Ian Jackson
2011-01-20 18:35                     ` chris
2011-01-21 18:59                       ` [Xen-devel] Re: xen-unstable: ImportError: No module named xen.xm [and 1 more messages] Ian Jackson
2011-01-21 15:30           ` Xen build - Debian vs Redhat layout patch options user virtual
2011-01-21 17:28             ` Bruce Edge
2011-01-21 18:42               ` Ian Jackson
2011-07-13 13:41                 ` User Virtual
2011-01-21 17:29             ` Stefano Stabellini
2011-01-21 18:40               ` Ian Jackson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTink2YkVEPLzmfUtR-6oH8eT3Lke+NqED9rjN_dN@mail.gmail.com \
    --to=bruce.edge@gmail.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=olaf@aepfle.de \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.