All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 7/7] systemd: add support initial xen systemd service files
@ 2014-03-19 21:07 Luis R. Rodriguez
  2014-03-20 20:53 ` M A Young
  2014-03-21 15:40 ` Ian Campbell
  0 siblings, 2 replies; 14+ messages in thread
From: Luis R. Rodriguez @ 2014-03-19 21:07 UTC (permalink / raw)
  To: xen-devel
  Cc: Ian Campbell, Stefano Stabellini, Luis R. Rodriguez,
	Jan Rękorajski, Ian Jackson, Jacek Konieczny, M A Young

From: "Luis R. Rodriguez" <mcgrof@suse.com>

These are originally based on the Fedora systemd files.

Changes made:

  * allow for xenstored configuration through *either* of these
    configuration files:
	- /etc/sysconfig/xenstored
	- /etc/default/xenstored
    The /etc/default/xenstored will let debian based systems do
    the same, while SUSE/OpenSUSE/Fedora/RedHat can keep on chugging
    with sysconfig
  * generalized path meta @VARIABLES@ which are configuration specific
  * uses new xenstore-read -l 30 -s prior to doing letting things rip
  * defines systemd socket for xenstored
  * ensures we create the run directory as most systems will likely
    be using a tmpfs for run dirs for the pid files
  * Some systems define the selinux context in the systemd Option for the
    /var/lib/xenstored tmpfs:
	Options=mode=755,context="system_u:object_r:xenstored_var_lib_t:s0"
    For the upstream version we remove that and let systems specify the
    context on their system /etc/default/xenstored or /etc/sysconfig/xenstored
    $XENSTORED_MOUNT_CTX variable
  * defines a modules-load.d for us
  * takes advantage of the shared xendomains helper for the xendomains
    service
  * Add the new dom0 that gets kicked off for disk backend access into
    its own systemd service associated to xen

We end up with these systemd files:

General requirements:

  * proc-xen.mount
  * var-lib-xenstored.mount

xenstored:

  * xenstored.socket
  * oxenstored.service
  * xenconsoled.service
  * xen-qemu-dom0-disk-backend.service.in

Optional:

  * xendomains.service
  * xen-watchdog.service

As for integration with xen, we house keep all the systemd files
under a new directory tools/hotplug/Linux/systemd/ and will be targetted
by default when building on Linux systems (CONFIG_Linux) given the low
overhead of only having to only sed the meta @VARIABLES@. The systemd
files will be sanitized for meta @VARIABLES@ upon the all make target by
default, and installed upon the install target. Systems that do not use
systemd will still have these files installed but can still just use the
old LSB init scripts; if they happen to get systemd they can easily
switch to it. The changes above only apply to systems that use systemd.

If you don't specify a prefix you will end up with the services
files under /usr/local/lib/systemd/system/ by default, and systemd
modules-load.d conf files under /usr/local/lib/modules-load.d/ which
systemd does look for (although it seems this is not documented).

Distributions are expected to provide their /usr/ prefix to end up in
the more generic location upon distribution install at
/usr/lib/systemd/system/ and /usr/lib/modules-load.d/ respectively.

Since we have a systemd socket defined for xenstored we may be able to
eventually remove our sanity check of tesing access to xenstored with
'xenstore-read -l 30 -s' but we keep it for now.

Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Jan Rękorajski <baggins@pld-linux.org>
Cc: M A Young <m.a.young@durham.ac.uk>
Cc: Jacek Konieczny <jajcus@jajcus.net>
Cc: xen-devel@lists.xenproject.org
Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
---
 .gitignore                                         |  5 ++
 Config.mk                                          |  9 ++-
 Makefile                                           | 11 +++-
 config/StdGNU.mk                                   |  4 ++
 tools/hotplug/Linux/Makefile                       |  8 ++-
 tools/hotplug/Linux/systemd/Makefile               | 72 ++++++++++++++++++++++
 tools/hotplug/Linux/systemd/oxenstored.service.in  | 23 +++++++
 tools/hotplug/Linux/systemd/proc-xen.mount.in      |  9 +++
 .../Linux/systemd/var-lib-xenstored.mount.in       | 13 ++++
 .../systemd/xen-qemu-dom0-disk-backend.service.in  | 22 +++++++
 .../hotplug/Linux/systemd/xen-watchdog.service.in  | 13 ++++
 .../Linux/systemd/xen.conf.modules-load.d.in       | 16 +++++
 tools/hotplug/Linux/systemd/xenconsoled.service.in | 20 ++++++
 tools/hotplug/Linux/systemd/xendomains.service.in  | 16 +++++
 tools/hotplug/Linux/systemd/xenstored.service.in   | 24 ++++++++
 tools/hotplug/Linux/systemd/xenstored.socket.in    |  9 +++
 16 files changed, 269 insertions(+), 5 deletions(-)
 create mode 100644 tools/hotplug/Linux/systemd/Makefile
 create mode 100644 tools/hotplug/Linux/systemd/oxenstored.service.in
 create mode 100644 tools/hotplug/Linux/systemd/proc-xen.mount.in
 create mode 100644 tools/hotplug/Linux/systemd/var-lib-xenstored.mount.in
 create mode 100644 tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in
 create mode 100644 tools/hotplug/Linux/systemd/xen-watchdog.service.in
 create mode 100644 tools/hotplug/Linux/systemd/xen.conf.modules-load.d.in
 create mode 100644 tools/hotplug/Linux/systemd/xenconsoled.service.in
 create mode 100644 tools/hotplug/Linux/systemd/xendomains.service.in
 create mode 100644 tools/hotplug/Linux/systemd/xenstored.service.in
 create mode 100644 tools/hotplug/Linux/systemd/xenstored.socket.in

diff --git a/.gitignore b/.gitignore
index db3b083..4d77d16 100644
--- a/.gitignore
+++ b/.gitignore
@@ -400,3 +400,8 @@ tools/xenstore/xenstore-watch
 docs/txt/misc/*.txt
 docs/txt/man/*.txt
 docs/figs/*.png
+
+tools/hotplug/Linux/systemd/*.conf
+tools/hotplug/Linux/systemd/*.mount
+tools/hotplug/Linux/systemd/*.socket
+tools/hotplug/Linux/systemd/*.service
diff --git a/Config.mk b/Config.mk
index 84c558b..24f9463 100644
--- a/Config.mk
+++ b/Config.mk
@@ -153,7 +153,12 @@ endef
 define buildmakevars2shellvars
     export PREFIX="$(PREFIX)";                                            \
     export XEN_SCRIPT_DIR="$(XEN_SCRIPT_DIR)";                            \
-    export XEN_ROOT="$(XEN_ROOT)"
+    export XEN_SYSTEMD_DIR="$(XEN_SYSTEMD_DIR)";                          \
+    export XEN_SYSTEMD_MODULES_LOAD="$(XEN_SYSTEMD_MODULES_LOAD=)";       \
+    export XEN_ROOT="$(XEN_ROOT)";                                        \
+    export XEN_RUN_DIR="$(XEN_RUN_DIR)";                                  \
+    export XEN_LOG_DIR="$(XEN_LOG_DIR)";                                  \
+    export XEN_LIB_STORED="$(XEN_LIB_STORED)"
 endef
 
 #
@@ -174,6 +179,8 @@ define buildmakevars2file-closure
 	$(foreach var,                                                      \
 	          SBINDIR BINDIR LIBEXEC LIBDIR SHAREDIR PRIVATE_BINDIR     \
 	          XENFIRMWAREDIR XEN_CONFIG_DIR XEN_SCRIPT_DIR XEN_LOCK_DIR \
+		  XEN_SYSTEMD_MODULES_LOAD				    \
+		  XEN_SYSTEMD_DIR XEN_LOG_DIR XEN_LIB_STORED                \
 	          XEN_RUN_DIR XEN_PAGING_DIR,                               \
 	          echo "$(var)=\"$($(var))\"" >>$(1).tmp;)        \
 	$(call move-if-changed,$(1).tmp,$(1))
diff --git a/Makefile b/Makefile
index 4e48457..8f6d479 100644
--- a/Makefile
+++ b/Makefile
@@ -243,8 +243,17 @@ uninstall:
 	rm -f  $(D)$(CONFIG_DIR)/udev/rules.d/xen-backend.rules
 	rm -f  $(D)$(CONFIG_DIR)/udev/rules.d/xend.rules
 	rm -f  $(D)$(SYSCONFIG_DIR)/xendomains
+	rm -f  $(D)$(SBINDIR)/xendomains
 	rm -f  $(D)$(SYSCONFIG_DIR)/xencommons
-	rm -rf $(D)/var/run/xen* $(D)/var/lib/xen*
+	rm -f  $(D)$(XEN_SYSTEMD_DIR)/xenconsoled.service
+	rm -f  $(D)$(XEN_SYSTEMD_DIR)/xendomains.service
+	rm -f  $(D)$(XEN_SYSTEMD_DIR)/xenstored.service
+	rm -f  $(D)$(XEN_SYSTEMD_DIR)/oxenstored.service
+	rm -f  $(D)$(XEN_SYSTEMD_DIR)/xen-watchdog.service
+	rm -f  $(D)$(XEN_SYSTEMD_DIR)/proc-xen.mount
+	rm -f  $(D)$(XEN_SYSTEMD_DIR)/var-lib-xenstored.mount
+	rm -f  $(D)$(XEN_SYSTEMD_MODULES_LOAD)/xen.conf
+	rm -rf $(D)${XEN_RUN_DIR}* $(D)/var/lib/xen*
 	make -C tools uninstall
 	rm -rf $(D)/boot/tboot*
 
diff --git a/config/StdGNU.mk b/config/StdGNU.mk
index 25fc594..70e1a40 100644
--- a/config/StdGNU.mk
+++ b/config/StdGNU.mk
@@ -44,12 +44,16 @@ PRIVATE_BINDIR = $(PRIVATE_PREFIX)/bin
 CONFIG_DIR = /etc
 XEN_LOCK_DIR = /var/lock
 XEN_RUN_DIR = /var/run/xen
+XEN_LOG_DIR = /var/log/xen
+XEN_LIB_STORED = /var/lib/xenstored
 XEN_PAGING_DIR = /var/lib/xen/xenpaging
 
 SYSCONFIG_DIR = $(CONFIG_DIR)/$(CONFIG_LEAF_DIR)
 
 XEN_CONFIG_DIR = $(CONFIG_DIR)/xen
 XEN_SCRIPT_DIR = $(XEN_CONFIG_DIR)/scripts
+XEN_SYSTEMD_DIR = $(PREFIX)/lib/systemd/system/
+XEN_SYSTEMD_MODULES_LOAD = $(PREFIX)/lib/modules-load.d/
 
 SOCKET_LIBS =
 UTIL_LIBS = -lutil
diff --git a/tools/hotplug/Linux/Makefile b/tools/hotplug/Linux/Makefile
index 0be2e8a..c62cbd1 100644
--- a/tools/hotplug/Linux/Makefile
+++ b/tools/hotplug/Linux/Makefile
@@ -26,6 +26,8 @@ XEN_SCRIPTS += vscsi
 XEN_SCRIPTS += block-iscsi
 XEN_SCRIPTS += $(XEN_SCRIPTS-y)
 
+SUBDIRS-y += systemd
+
 XEN_SCRIPT_DATA = xen-script-common.sh locking.sh logging.sh
 XEN_SCRIPT_DATA += xen-hotplug-common.sh xen-network-common.sh vif-common.sh
 XEN_SCRIPT_DATA += block-common.sh
@@ -35,13 +37,13 @@ UDEV_RULES-$(CONFIG_XEND) = xend.rules
 UDEV_RULES = xen-backend.rules $(UDEV_RULES-y)
 
 .PHONY: all
-all:
+all: subdirs-all
 
 .PHONY: build
 build:
 
 .PHONY: install
-install: all install-initd install-scripts install-udev
+install: all install-initd install-scripts install-udev subdirs-install
 
 # See docs/misc/distro_mapping.txt for INITD_DIR location
 .PHONY: install-initd
@@ -81,4 +83,4 @@ install-udev:
 	done
 
 .PHONY: clean
-clean:
+clean: subdirs-clean
diff --git a/tools/hotplug/Linux/systemd/Makefile b/tools/hotplug/Linux/systemd/Makefile
new file mode 100644
index 0000000..cf898d5
--- /dev/null
+++ b/tools/hotplug/Linux/systemd/Makefile
@@ -0,0 +1,72 @@
+XEN_ROOT = $(CURDIR)/../../../..
+include $(XEN_ROOT)/tools/Rules.mk
+
+XEN_SYSTEMD_MODULES = xen.conf
+
+XEN_SYSTEMD_MOUNT =  proc-xen.mount
+XEN_SYSTEMD_MOUNT += var-lib-xenstored.mount
+
+XEN_SYSTEMD_SOCKET += xenstored.socket
+
+XEN_SYSTEMD_SERVICE  = xenstored.service
+XEN_SYSTEMD_SERVICE += oxenstored.service
+XEN_SYSTEMD_SERVICE += xenconsoled.service
+XEN_SYSTEMD_SERVICE += xen-qemu-dom0-disk-backend.service
+XEN_SYSTEMD_SERVICE += xendomains.service
+XEN_SYSTEMD_SERVICE += xen-watchdog.service
+
+ALL_XEN_SYSTEMD =	$(XEN_SYSTEMD_MODULES) \
+			$(XEN_SYSTEMD_MOUNT)	\
+			$(XEN_SYSTEMD_SOCKET)	\
+			$(XEN_SYSTEMD_SERVICE)
+
+.PHONY: all
+all:	$(ALL_XEN_SYSTEMD)
+
+.PHONY: clean
+clean:
+	rm -f *.service *.mount *.conf
+
+.PHONY: install
+install: $(ALL_XEN_SYSTEMD)
+	[ -d $(DESTDIR)$(XEN_SYSTEMD_DIR) ] || \
+		$(INSTALL_DIR) $(DESTDIR)$(XEN_SYSTEMD_DIR)
+	[ -d $(DESTDIR)$(XEN_SYSTEMD_MODULES_LOAD) ] || \
+		$(INSTALL_DIR) $(DESTDIR)$(XEN_SYSTEMD_MODULES_LOAD)
+	$(INSTALL_DATA) *.socket $(DESTDIR)$(XEN_SYSTEMD_DIR)
+	$(INSTALL_DATA) *.service $(DESTDIR)$(XEN_SYSTEMD_DIR)
+	$(INSTALL_DATA) *.mount $(DESTDIR)$(XEN_SYSTEMD_DIR)
+	$(INSTALL_DATA) *.conf $(DESTDIR)$(XEN_SYSTEMD_MODULES_LOAD)
+
+%.socket: %.socket.in
+	cp $< $@
+	@sed -i -e 's|\@SBINDIR\@|$(SBINDIR)|g'                $@
+	@sed -i -e 's|\@BINDIR\@|$(BINDIR)|g'                  $@
+	@sed -i -e 's|\@XEN_RUN_DIR\@|$(XEN_RUN_DIR)|g'        $@
+	@sed -i -e 's|\@XEN_LOG_DIR\@|$(XEN_LOG_DIR)|g'        $@
+	@sed -i -e 's|\@XEN_LIB_STORED\@|$(XEN_LIB_STORED)|g'  $@
+	@sed -i -e 's|\@LIBEXEC\@|$(LIBEXEC)|g'                $@
+
+%.service: %.service.in
+	cp $< $@
+	@sed -i -e 's|\@SBINDIR\@|$(SBINDIR)|g'                $@
+	@sed -i -e 's|\@BINDIR\@|$(BINDIR)|g'                  $@
+	@sed -i -e 's|\@XEN_RUN_DIR\@|$(XEN_RUN_DIR)|g'        $@
+	@sed -i -e 's|\@XEN_LOG_DIR\@|$(XEN_LOG_DIR)|g'        $@
+	@sed -i -e 's|\@XEN_LIB_STORED\@|$(XEN_LIB_STORED)|g'  $@
+	@sed -i -e 's|\@LIBEXEC\@|$(LIBEXEC)|g'                $@
+
+%.mount: %.mount.in
+	cp $< $@
+	@sed -i -e 's|\@SBINDIR\@|$(SBINDIR)|g'                $@
+	@sed -i -e 's|\@BINDIR\@|$(BINDIR)|g'                  $@
+	@sed -i -e 's|\@XEN_RUN_DIR\@|$(XEN_RUN_DIR)|g'        $@
+	@sed -i -e 's|\@XEN_LOG_DIR\@|$(XEN_LOG_DIR)|g'        $@
+	@sed -i -e 's|\@XEN_LIB_STORED\@|$(XEN_LIB_STORED)|g'  $@
+	@sed -i -e 's|\@LIBEXEC\@|$(LIBEXEC)|g'                $@
+
+%.conf: %.conf.modules-load.d.in
+	cp $< $@
+
+.PHONY: clean
+clean:
diff --git a/tools/hotplug/Linux/systemd/oxenstored.service.in b/tools/hotplug/Linux/systemd/oxenstored.service.in
new file mode 100644
index 0000000..f9bd272
--- /dev/null
+++ b/tools/hotplug/Linux/systemd/oxenstored.service.in
@@ -0,0 +1,23 @@
+[Unit]
+Description=Oxenstored - ocaml version of daemon managing xenstore file system
+Requires=proc-xen.mount var-lib-xenstored.mount xenstored.socket
+After=proc-xen.mount var-lib-xenstored.mount
+Before=libvirtd.service libvirt-guests.service
+Conflicts=xenstored.service
+RefuseManualStop=true
+ConditionPathIsDirectory=/proc/xen
+
+[Service]
+Type=forking
+Environment=XENSTORED_ARGS=
+EnvironmentFile=-/etc/default/xenstored
+EnvironmentFile=-/etc/sysconfig/xenstored
+PIDFile=@XEN_RUN_DIR@/xenstored.pid
+ExecStartPre=/bin/grep -q control_d /proc/xen/capabilities
+ExecStartPre=/bin/mkdir -p @XEN_RUN_DIR@
+ExecStart=@SBINDIR@/oxenstored --pid-file @XEN_RUN_DIR@/xenstored.pid $XENSTORED_ARGS
+ExecStartPost=@BINDIR@/xenstore-read -l 30 -s /
+ExecStartPost=-@BINDIR@/xenstore-write "/local/domain/0/name" "Domain-0"
+
+[Install]
+WantedBy=multi-user.target
diff --git a/tools/hotplug/Linux/systemd/proc-xen.mount.in b/tools/hotplug/Linux/systemd/proc-xen.mount.in
new file mode 100644
index 0000000..6eb61b2
--- /dev/null
+++ b/tools/hotplug/Linux/systemd/proc-xen.mount.in
@@ -0,0 +1,9 @@
+[Unit]
+Description=Mount /proc/xen files
+ConditionPathIsDirectory=/proc/xen
+RefuseManualStop=true
+
+[Mount]
+What=xenfs
+Where=/proc/xen
+Type=xenfs
diff --git a/tools/hotplug/Linux/systemd/var-lib-xenstored.mount.in b/tools/hotplug/Linux/systemd/var-lib-xenstored.mount.in
new file mode 100644
index 0000000..a393b06
--- /dev/null
+++ b/tools/hotplug/Linux/systemd/var-lib-xenstored.mount.in
@@ -0,0 +1,13 @@
+[Unit]
+Description=mount xenstore file system
+ConditionPathIsDirectory=/proc/xen
+RefuseManualStop=true
+
+[Mount]
+Environment=XENSTORED_MOUNT_CTX=
+EnvironmentFile=-/etc/sysconfig/xenstored
+EnvironmentFile=-/etc/default/xenstored
+What=xenstore
+Where=@XEN_LIB_STORED@
+Type=tmpfs
+Options=mode=755,context="$XENSTORED_MOUNT_CTX"
diff --git a/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in b/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in
new file mode 100644
index 0000000..39a82bc
--- /dev/null
+++ b/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in
@@ -0,0 +1,22 @@
+[Unit]
+Description=qemu for xen dom0 disk backend
+Requires=proc-xen.mount var-lib-xenstored.mount xenstored.socket
+After=proc-xen.mount xenstored.service oxenstored.service xenconsoled.service
+Before=xendomains.service libvirtd.service libvirt-guests.service
+RefuseManualStop=true
+ConditionPathIsDirectory=/proc/xen
+
+[Service]
+Type=forking
+EnvironmentFile=-/etc/default/xenstored
+EnvironmentFile=-/etc/sysconfig/xenstored
+PIDFile=@XEN_RUN_DIR@/qemu-dom0.pid
+ExecStartPre=/bin/grep -q control_d /proc/xen/capabilities
+ExecStartPre=/bin/mkdir -p /var/run/xen
+ExecStart=@LIBEXEC@/qemu-system-i386 -xen-domid 0 \
+	-xen-attach -name dom0 -nographic -M xenpv -daemonize \
+	-monitor /dev/null -serial /dev/null -parallel /dev/null \
+	-pidfile @XEN_RUN_DIR@/qemu-dom0.pid
+
+[Install]
+WantedBy=multi-user.target
diff --git a/tools/hotplug/Linux/systemd/xen-watchdog.service.in b/tools/hotplug/Linux/systemd/xen-watchdog.service.in
new file mode 100644
index 0000000..063fefb
--- /dev/null
+++ b/tools/hotplug/Linux/systemd/xen-watchdog.service.in
@@ -0,0 +1,13 @@
+[Unit]
+Description=Xen-watchdog - run xen watchdog daemon
+Requires=proc-xen.mount
+After=proc-xen.mount xend.service
+ConditionPathIsDirectory=/proc/xen
+
+[Service]
+Type=forking
+ExecStart=@SBINDIR@/xenwatchdogd 30 15
+KillSignal=USR1
+
+[Install]
+WantedBy=multi-user.target
diff --git a/tools/hotplug/Linux/systemd/xen.conf.modules-load.d.in b/tools/hotplug/Linux/systemd/xen.conf.modules-load.d.in
new file mode 100644
index 0000000..3fbd59b
--- /dev/null
+++ b/tools/hotplug/Linux/systemd/xen.conf.modules-load.d.in
@@ -0,0 +1,16 @@
+xen-evtchn
+xen-gntdev
+xen-gntalloc
+xen-blkback
+xen-netback
+xen-pciback
+evtchn
+gntdev
+netbk
+blkbk
+xen-scsibk
+usbbk
+pciback
+xen-acpi-processor
+blktap2
+blktap
diff --git a/tools/hotplug/Linux/systemd/xenconsoled.service.in b/tools/hotplug/Linux/systemd/xenconsoled.service.in
new file mode 100644
index 0000000..77c3965
--- /dev/null
+++ b/tools/hotplug/Linux/systemd/xenconsoled.service.in
@@ -0,0 +1,20 @@
+[Unit]
+Description=Xenconsoled - handles logging from guest consoles and hypervisor
+Requires=proc-xen.mount
+After=proc-xen.mount xenstored.service oxenstored.service
+ConditionPathIsDirectory=/proc/xen
+
+[Service]
+Type=simple
+Environment=XENCONSOLED_ARGS=
+Environment=XENCONSOLED_LOG=none
+Environment=XENCONSOLED_LOG_DIR=@XEN_LOG_DIR@/console
+EnvironmentFile=-/etc/default/xenconsoled
+EnvironmentFile=-/etc/sysconfig/xenconsoled
+PIDFile=@XEN_RUN_DIR@/xenconsoled.pid
+ExecStartPre=/bin/grep -q control_d /proc/xen/capabilities
+ExecStartPre=/bin/mkdir -p @XEN_RUN_DIR@
+ExecStart=@SBINDIR@/xenconsoled --pid-file @XEN_RUN_DIR@/xenconsoled.pid --log=${XENCONSOLED_LOG} --log-dir=${XENCONSOLED_LOG_DIR} $XENCONSOLED_ARGS
+
+[Install]
+WantedBy=multi-user.target
diff --git a/tools/hotplug/Linux/systemd/xendomains.service.in b/tools/hotplug/Linux/systemd/xendomains.service.in
new file mode 100644
index 0000000..35beeaf
--- /dev/null
+++ b/tools/hotplug/Linux/systemd/xendomains.service.in
@@ -0,0 +1,16 @@
+[Unit]
+Description=Xendomains - start and stop guests on boot and shutdown
+Requires=proc-xen.mount
+After=proc-xen.mount xenstored.service xenconsoled.service oxenstored.service
+ConditionPathIsDirectory=/proc/xen
+
+[Service]
+Type=oneshot
+RemainAfterExit=true
+ExecStartPre=/bin/grep -q control_d /proc/xen/capabilities
+ExecStart=-@SBINDIR@/xendomains start
+ExecStop=@SBINDIR@/xendomains stop
+ExecReload=@SBINDIR@/xendomains restart
+
+[Install]
+WantedBy=multi-user.target
diff --git a/tools/hotplug/Linux/systemd/xenstored.service.in b/tools/hotplug/Linux/systemd/xenstored.service.in
new file mode 100644
index 0000000..6a45020
--- /dev/null
+++ b/tools/hotplug/Linux/systemd/xenstored.service.in
@@ -0,0 +1,24 @@
+[Unit]
+Description=Xenstored - daemon managing xenstore file system
+Requires=proc-xen.mount var-lib-xenstored.mount xenstored.socket
+After=proc-xen.mount var-lib-xenstored.mount
+Before=libvirtd.service libvirt-guests.service
+RefuseManualStop=true
+ConditionPathIsDirectory=/proc/xen
+
+[Service]
+Type=forking
+Environment=XENSTORED_ARGS=
+Environment=XENSTORED_ROOTDIR=@XEN_LIB_STORED@
+EnvironmentFile=-/etc/default/xenstored
+EnvironmentFile=-/etc/sysconfig/xenstored
+PIDFile=@XEN_RUN_DIR@/xenstored.pid
+ExecStartPre=/bin/grep -q control_d /proc/xen/capabilities
+ExecStartPre=-/bin/rm -f @XEN_LIB_STORED@/tdb*
+ExecStartPre=/bin/mkdir -p @XEN_RUN_DIR@
+ExecStart=@SBINDIR@/xenstored --pid-file @XEN_RUN_DIR@/xenstored.pid $XENSTORED_ARGS
+ExecStartPost=@BINDIR@/xenstore-read -l 30 -s /
+ExecStartPost=@BINDIR@/xenstore-write "/local/domain/0/name" "Domain-0"
+
+[Install]
+WantedBy=multi-user.target
diff --git a/tools/hotplug/Linux/systemd/xenstored.socket.in b/tools/hotplug/Linux/systemd/xenstored.socket.in
new file mode 100644
index 0000000..2091b82
--- /dev/null
+++ b/tools/hotplug/Linux/systemd/xenstored.socket.in
@@ -0,0 +1,9 @@
+[Unit]
+Description=Xen xenstored / oxenstored Activation Socket
+
+[Socket]
+ListenStream=@XEN_LIB_STORED@/socket
+ListenStream=@XEN_LIB_STORED@/socket_ro
+
+[Install]
+WantedBy=sockets.target
-- 
1.9.0


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

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH v3 7/7] systemd: add support initial xen systemd service files
  2014-03-19 21:07 [PATCH v3 7/7] systemd: add support initial xen systemd service files Luis R. Rodriguez
@ 2014-03-20 20:53 ` M A Young
  2014-03-20 21:02   ` Luis R. Rodriguez
  2014-03-21 15:40 ` Ian Campbell
  1 sibling, 1 reply; 14+ messages in thread
From: M A Young @ 2014-03-20 20:53 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: Ian Campbell, Stefano Stabellini, Luis R. Rodriguez,
	Jan Rękorajski, Ian Jackson, Jacek Konieczny, xen-devel

I have not read through this fully, but xenstored.service and 
oxenstored.service need an additional line like
ExecStartPost=-/usr/bin/xenstore-write "/local/domain/0/domid" 0
for xen 4.4 and later.

 	Michael Young

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v3 7/7] systemd: add support initial xen systemd service files
  2014-03-20 20:53 ` M A Young
@ 2014-03-20 21:02   ` Luis R. Rodriguez
  2014-03-20 21:19     ` M A Young
  0 siblings, 1 reply; 14+ messages in thread
From: Luis R. Rodriguez @ 2014-03-20 21:02 UTC (permalink / raw)
  To: M A Young
  Cc: Ian Campbell, Stefano Stabellini, Jan Rękorajski,
	Ian Jackson, Jacek Konieczny, xen-devel

On Thu, Mar 20, 2014 at 1:53 PM, M A Young <m.a.young@durham.ac.uk> wrote:
> I have not read through this fully, but xenstored.service and
> oxenstored.service need an additional line like
> ExecStartPost=-/usr/bin/xenstore-write "/local/domain/0/domid" 0
> for xen 4.4 and later.

It was there for both, but now that I look at it I had only made this
optional to fail on oxenstore. The init script lets it fail so I
suppose letting it fail on both is OK, but perhaps its a good time to
think about if we want to allow that to fail.

While doing some more testing another thing I noticed was that the
trick I was expecting to work of having
xen-qemu-dom0-disk-backend.service.in to Require xenstored.socket
instead of either xenstored.service or oxenstored.service doesn't cut
it, even if we explicitly claim the socket within the store services.
Let me know if anyone sees a away to use logic within systemd to make
a service exclusively through sockets for services that provide their
own ExecStart but just don't see it now. If we can't find a way that
may mean we either have to write our own wrapper C program to check
for both or have this configurable upon build. As for the later I at
least don't get oxenstored being built by default, even though it
seems I probably should as that is the way of the future, so we'd have
to just lave the C xenstored as the default for now I guess.

  Luis

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v3 7/7] systemd: add support initial xen systemd service files
  2014-03-20 21:02   ` Luis R. Rodriguez
@ 2014-03-20 21:19     ` M A Young
  2014-03-20 21:50       ` Luis R. Rodriguez
  0 siblings, 1 reply; 14+ messages in thread
From: M A Young @ 2014-03-20 21:19 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: Ian Campbell, Stefano Stabellini, Jan Rękorajski,
	Ian Jackson, Jacek Konieczny, xen-devel

On Thu, 20 Mar 2014, Luis R. Rodriguez wrote:

> On Thu, Mar 20, 2014 at 1:53 PM, M A Young <m.a.young@durham.ac.uk> wrote:
>> I have not read through this fully, but xenstored.service and
>> oxenstored.service need an additional line like
>> ExecStartPost=-/usr/bin/xenstore-write "/local/domain/0/domid" 0
>> for xen 4.4 and later.
>
> It was there for both, but now that I look at it I had only made this
> optional to fail on oxenstore. The init script lets it fail so I
> suppose letting it fail on both is OK, but perhaps its a good time to
> think about if we want to allow that to fail.

I think you missed my point. For xen 4.3, which is I am guessing is the 
version of the Fedora package you took the systemd files from, you have

ExecStartPost=-/usr/bin/xenstore-write "/local/domain/0/name" "Domain-0"

For xen 4.4 and later you need

ExecStartPost=-/usr/bin/xenstore-write "/local/domain/0/domid" 0

as well.

 	Michael Young

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v3 7/7] systemd: add support initial xen systemd service files
  2014-03-20 21:19     ` M A Young
@ 2014-03-20 21:50       ` Luis R. Rodriguez
  2014-03-20 22:10         ` M A Young
  0 siblings, 1 reply; 14+ messages in thread
From: Luis R. Rodriguez @ 2014-03-20 21:50 UTC (permalink / raw)
  To: M A Young
  Cc: Ian Campbell, Stefano Stabellini, Jan Rękorajski,
	Ian Jackson, Jacek Konieczny, xen-devel

On Thu, Mar 20, 2014 at 2:19 PM, M A Young <m.a.young@durham.ac.uk> wrote:
> I think you missed my point.

Indeed.

> For xen 4.3, which is I am guessing is the version of the Fedora package you took the systemd files from

I snatched what I could from git://pkgs.fedoraproject.org/xen.git

> you have
>
> ExecStartPost=-/usr/bin/xenstore-write "/local/domain/0/name" "Domain-0"
>
> For xen 4.4 and later you need
>
> ExecStartPost=-/usr/bin/xenstore-write "/local/domain/0/domid" 0
>
> as well.

As well as in both? If not then I would prefer to deal only with what
is required for upstream and let packages deal with this for their own
versions.

  Luis

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v3 7/7] systemd: add support initial xen systemd service files
  2014-03-20 21:50       ` Luis R. Rodriguez
@ 2014-03-20 22:10         ` M A Young
  2014-03-20 22:22           ` Luis R. Rodriguez
  2014-04-28 13:08           ` Luis R. Rodriguez
  0 siblings, 2 replies; 14+ messages in thread
From: M A Young @ 2014-03-20 22:10 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: Ian Campbell, Stefano Stabellini, Jan Rękorajski,
	Ian Jackson, Jacek Konieczny, xen-devel

On Thu, 20 Mar 2014, Luis R. Rodriguez wrote:

> On Thu, Mar 20, 2014 at 2:19 PM, M A Young <m.a.young@durham.ac.uk> wrote:
>> I think you missed my point.
>
> Indeed.
>
>> For xen 4.3, which is I am guessing is the version of the Fedora package you took the systemd files from
>
> I snatched what I could from git://pkgs.fedoraproject.org/xen.git
>
>> you have
>>
>> ExecStartPost=-/usr/bin/xenstore-write "/local/domain/0/name" "Domain-0"
>>
>> For xen 4.4 and later you need
>>
>> ExecStartPost=-/usr/bin/xenstore-write "/local/domain/0/domid" 0
>>
>> as well.
>
> As well as in both? If not then I would prefer to deal only with what
> is required for upstream and let packages deal with this for their own
> versions.

You need both lines in both xenstored.service and oxenstored.service. This 
reflects this commit
http://xenbits.xenproject.org/gitweb/?p=xen.git;a=commit;h=02ebea7768fe723deaa56c2cfcb860874544b47d
adding the second line to the xencommons init.d scripts between xen 4.3 
and xen 4.4 . I know from testing that you can have trouble starting 
guests with xl if you leave the second line out.

 	Michael Young

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v3 7/7] systemd: add support initial xen systemd service files
  2014-03-20 22:10         ` M A Young
@ 2014-03-20 22:22           ` Luis R. Rodriguez
  2014-03-21 11:16             ` Ian Jackson
  2014-04-28 13:08           ` Luis R. Rodriguez
  1 sibling, 1 reply; 14+ messages in thread
From: Luis R. Rodriguez @ 2014-03-20 22:22 UTC (permalink / raw)
  To: M A Young
  Cc: Ian Campbell, Stefano Stabellini, Jan Rękorajski,
	Ian Jackson, Jacek Konieczny, xen-devel

On Thu, Mar 20, 2014 at 3:10 PM, M A Young <m.a.young@durham.ac.uk> wrote:
> You need both lines in both xenstored.service and oxenstored.service. This
> reflects this commit
> http://xenbits.xenproject.org/gitweb/?p=xen.git;a=commit;h=02ebea7768fe723deaa56c2cfcb860874544b47d
> adding the second line to the xencommons init.d scripts between xen 4.3 and
> xen 4.4 . I know from testing that you can have trouble starting guests with
> xl if you leave the second line out.


Ok thanks for the clarification, will respin and add both, with - prefix.

  Luis

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v3 7/7] systemd: add support initial xen systemd service files
  2014-03-20 22:22           ` Luis R. Rodriguez
@ 2014-03-21 11:16             ` Ian Jackson
  2014-03-21 11:44               ` Ian Campbell
  0 siblings, 1 reply; 14+ messages in thread
From: Ian Jackson @ 2014-03-21 11:16 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: Ian Campbell, Stefano Stabellini, Jan Rękorajski,
	Jacek Konieczny, M A Young, xen-devel

Luis R. Rodriguez writes ("Re: [PATCH v3 7/7] systemd: add support initial xen systemd service files"):
> On Thu, Mar 20, 2014 at 3:10 PM, M A Young <m.a.young@durham.ac.uk> wrote:
> > You need both lines in both xenstored.service and oxenstored.service. This
> > reflects this commit
> > http://xenbits.xenproject.org/gitweb/?p=xen.git;a=commit;h=02ebea7768fe723deaa56c2cfcb860874544b47d
> > adding the second line to the xencommons init.d scripts between xen 4.3 and
> > xen 4.4 . I know from testing that you can have trouble starting guests with
> > xl if you leave the second line out.
> 
> 
> Ok thanks for the clarification, will respin and add both, with - prefix.

Surely this code should appear exactly once in the tree.

Ian.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v3 7/7] systemd: add support initial xen systemd service files
  2014-03-21 11:16             ` Ian Jackson
@ 2014-03-21 11:44               ` Ian Campbell
  0 siblings, 0 replies; 14+ messages in thread
From: Ian Campbell @ 2014-03-21 11:44 UTC (permalink / raw)
  To: Ian Jackson
  Cc: Stefano Stabellini, Jan Rękorajski, Jacek Konieczny,
	M A Young, xen-devel, Luis R. Rodriguez

On Fri, 2014-03-21 at 11:16 +0000, Ian Jackson wrote:
> Luis R. Rodriguez writes ("Re: [PATCH v3 7/7] systemd: add support initial xen systemd service files"):
> > On Thu, Mar 20, 2014 at 3:10 PM, M A Young <m.a.young@durham.ac.uk> wrote:
> > > You need both lines in both xenstored.service and oxenstored.service. This
> > > reflects this commit
> > > http://xenbits.xenproject.org/gitweb/?p=xen.git;a=commit;h=02ebea7768fe723deaa56c2cfcb860874544b47d
> > > adding the second line to the xencommons init.d scripts between xen 4.3 and
> > > xen 4.4 . I know from testing that you can have trouble starting guests with
> > > xl if you leave the second line out.
> > 
> > 
> > Ok thanks for the clarification, will respin and add both, with - prefix.
> 
> Surely this code should appear exactly once in the tree.

Certainly exactly once in a given set of init system integration!

I don't want block the addition of such integration based on a plan to
eventually have some sort of common meta initscript system, but in this
particular case a common $libexec/xenstored script which the sysvinit
scripts and systemd services (and any other initscript) can call seems
like a reasonable thing to do.

Ian.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v3 7/7] systemd: add support initial xen systemd service files
  2014-03-19 21:07 [PATCH v3 7/7] systemd: add support initial xen systemd service files Luis R. Rodriguez
  2014-03-20 20:53 ` M A Young
@ 2014-03-21 15:40 ` Ian Campbell
  2014-03-22  2:30   ` Luis R. Rodriguez
  1 sibling, 1 reply; 14+ messages in thread
From: Ian Campbell @ 2014-03-21 15:40 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: Stefano Stabellini, Luis R. Rodriguez, Jan Rękorajski,
	Ian Jackson, Jacek Konieczny, M A Young, xen-devel

On Wed, 2014-03-19 at 14:07 -0700, Luis R. Rodriguez wrote:
> As for integration with xen, we house keep all the systemd files
> under a new directory tools/hotplug/Linux/systemd/ and will be
> targetted
> by default when building on Linux systems (CONFIG_Linux) given the low
> overhead of only having to only sed the meta @VARIABLES@.

Could configure not generate these more easily than what you have below?
It could still be conditional on Linux I'd have though, given a little
bit of autofoo ninjutsu.

> +%.socket: %.socket.in
> +       cp $< $@
> +       @sed -i -e 's|\@SBINDIR\@|$(SBINDIR)|g'                $@
> +       @sed -i -e 's|\@BINDIR\@|$(BINDIR)|g'                  $@
> +       @sed -i -e 's|\@XEN_RUN_DIR\@|$(XEN_RUN_DIR)|g'        $@
> +       @sed -i -e 's|\@XEN_LOG_DIR\@|$(XEN_LOG_DIR)|g'        $@
> +       @sed -i -e 's|\@XEN_LIB_STORED\@|$(XEN_LIB_STORED)|g'  $@
> +       @sed -i -e 's|\@LIBEXEC\@|$(LIBEXEC)|g'                $@
> +
> +%.service: %.service.in
> +       cp $< $@
> +       @sed -i -e 's|\@SBINDIR\@|$(SBINDIR)|g'                $@
> +       @sed -i -e 's|\@BINDIR\@|$(BINDIR)|g'                  $@
> +       @sed -i -e 's|\@XEN_RUN_DIR\@|$(XEN_RUN_DIR)|g'        $@
> +       @sed -i -e 's|\@XEN_LOG_DIR\@|$(XEN_LOG_DIR)|g'        $@
> +       @sed -i -e 's|\@XEN_LIB_STORED\@|$(XEN_LIB_STORED)|g'  $@
> +       @sed -i -e 's|\@LIBEXEC\@|$(LIBEXEC)|g'                $@
> +
> +%.mount: %.mount.in
> +       cp $< $@
> +       @sed -i -e 's|\@SBINDIR\@|$(SBINDIR)|g'                $@
> +       @sed -i -e 's|\@BINDIR\@|$(BINDIR)|g'                  $@
> +       @sed -i -e 's|\@XEN_RUN_DIR\@|$(XEN_RUN_DIR)|g'        $@
> +       @sed -i -e 's|\@XEN_LOG_DIR\@|$(XEN_LOG_DIR)|g'        $@
> +       @sed -i -e 's|\@XEN_LIB_STORED\@|$(XEN_LIB_STORED)|g'  $@
> +       @sed -i -e 's|\@LIBEXEC\@|$(LIBEXEC)|g'                $@ 

If you do keep this then itis crying out for a helper macro/make
function.

I though we had one TBH.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v3 7/7] systemd: add support initial xen systemd service files
  2014-03-21 15:40 ` Ian Campbell
@ 2014-03-22  2:30   ` Luis R. Rodriguez
  2014-03-24 10:14     ` Ian Campbell
  0 siblings, 1 reply; 14+ messages in thread
From: Luis R. Rodriguez @ 2014-03-22  2:30 UTC (permalink / raw)
  To: Ian Campbell
  Cc: Stefano Stabellini, Jan Rękorajski, Ian Jackson,
	Jacek Konieczny, M A Young, xen-devel, Luis R. Rodriguez


[-- Attachment #1.1: Type: text/plain, Size: 2339 bytes --]

On Fri, Mar 21, 2014 at 03:40:50PM +0000, Ian Campbell wrote:
> On Wed, 2014-03-19 at 14:07 -0700, Luis R. Rodriguez wrote:
> > As for integration with xen, we house keep all the systemd files
> > under a new directory tools/hotplug/Linux/systemd/ and will be
> > targetted
> > by default when building on Linux systems (CONFIG_Linux) given the low
> > overhead of only having to only sed the meta @VARIABLES@.
> 
> Could configure not generate these more easily than what you have below?

Not sure, I've dodged configure all my life.

> It could still be conditional on Linux I'd have though, given a little
> bit of autofoo ninjutsu.

I'm autofoo dumb.

> > +%.socket: %.socket.in
> > +       cp $< $@
> > +       @sed -i -e 's|\@SBINDIR\@|$(SBINDIR)|g'                $@
> > +       @sed -i -e 's|\@BINDIR\@|$(BINDIR)|g'                  $@
> > +       @sed -i -e 's|\@XEN_RUN_DIR\@|$(XEN_RUN_DIR)|g'        $@
> > +       @sed -i -e 's|\@XEN_LOG_DIR\@|$(XEN_LOG_DIR)|g'        $@
> > +       @sed -i -e 's|\@XEN_LIB_STORED\@|$(XEN_LIB_STORED)|g'  $@
> > +       @sed -i -e 's|\@LIBEXEC\@|$(LIBEXEC)|g'                $@
> > +
> > +%.service: %.service.in
> > +       cp $< $@
> > +       @sed -i -e 's|\@SBINDIR\@|$(SBINDIR)|g'                $@
> > +       @sed -i -e 's|\@BINDIR\@|$(BINDIR)|g'                  $@
> > +       @sed -i -e 's|\@XEN_RUN_DIR\@|$(XEN_RUN_DIR)|g'        $@
> > +       @sed -i -e 's|\@XEN_LOG_DIR\@|$(XEN_LOG_DIR)|g'        $@
> > +       @sed -i -e 's|\@XEN_LIB_STORED\@|$(XEN_LIB_STORED)|g'  $@
> > +       @sed -i -e 's|\@LIBEXEC\@|$(LIBEXEC)|g'                $@
> > +
> > +%.mount: %.mount.in
> > +       cp $< $@
> > +       @sed -i -e 's|\@SBINDIR\@|$(SBINDIR)|g'                $@
> > +       @sed -i -e 's|\@BINDIR\@|$(BINDIR)|g'                  $@
> > +       @sed -i -e 's|\@XEN_RUN_DIR\@|$(XEN_RUN_DIR)|g'        $@
> > +       @sed -i -e 's|\@XEN_LOG_DIR\@|$(XEN_LOG_DIR)|g'        $@
> > +       @sed -i -e 's|\@XEN_LIB_STORED\@|$(XEN_LIB_STORED)|g'  $@
> > +       @sed -i -e 's|\@LIBEXEC\@|$(LIBEXEC)|g'                $@ 
> 
> If you do keep this then itis crying out for a helper macro/make
> function.

Can we welcome this as an enhancement?

> I though we had one TBH.

I don't see one, but haven't looked under every rug.

  Luis

[-- Attachment #1.2: Type: application/pgp-signature, Size: 835 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v3 7/7] systemd: add support initial xen systemd service files
  2014-03-22  2:30   ` Luis R. Rodriguez
@ 2014-03-24 10:14     ` Ian Campbell
  2014-04-28 12:56       ` Luis R. Rodriguez
  0 siblings, 1 reply; 14+ messages in thread
From: Ian Campbell @ 2014-03-24 10:14 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: Stefano Stabellini, Jan Rękorajski, Ian Jackson,
	Jacek Konieczny, M A Young, xen-devel, Luis R. Rodriguez

On Sat, 2014-03-22 at 03:30 +0100, Luis R. Rodriguez wrote:
> On Fri, Mar 21, 2014 at 03:40:50PM +0000, Ian Campbell wrote:
> > On Wed, 2014-03-19 at 14:07 -0700, Luis R. Rodriguez wrote:
> > > As for integration with xen, we house keep all the systemd files
> > > under a new directory tools/hotplug/Linux/systemd/ and will be
> > > targetted
> > > by default when building on Linux systems (CONFIG_Linux) given the low
> > > overhead of only having to only sed the meta @VARIABLES@.
> > 
> > Could configure not generate these more easily than what you have below?
> 
> Not sure, I've dodged configure all my life.
> 
> > It could still be conditional on Linux I'd have though, given a little
> > bit of autofoo ninjutsu.
> 
> I'm autofoo dumb.

For this case I think you just need to add the files to
tools/configure.ac:AC_CONFIG_FILES

> > > +%.socket: %.socket.in
> > > +       cp $< $@
> > > +       @sed -i -e 's|\@SBINDIR\@|$(SBINDIR)|g'                $@
> > > +       @sed -i -e 's|\@BINDIR\@|$(BINDIR)|g'                  $@
> > > +       @sed -i -e 's|\@XEN_RUN_DIR\@|$(XEN_RUN_DIR)|g'        $@
> > > +       @sed -i -e 's|\@XEN_LOG_DIR\@|$(XEN_LOG_DIR)|g'        $@
> > > +       @sed -i -e 's|\@XEN_LIB_STORED\@|$(XEN_LIB_STORED)|g'  $@
> > > +       @sed -i -e 's|\@LIBEXEC\@|$(LIBEXEC)|g'                $@
> > > +
> > > +%.service: %.service.in
> > > +       cp $< $@
> > > +       @sed -i -e 's|\@SBINDIR\@|$(SBINDIR)|g'                $@
> > > +       @sed -i -e 's|\@BINDIR\@|$(BINDIR)|g'                  $@
> > > +       @sed -i -e 's|\@XEN_RUN_DIR\@|$(XEN_RUN_DIR)|g'        $@
> > > +       @sed -i -e 's|\@XEN_LOG_DIR\@|$(XEN_LOG_DIR)|g'        $@
> > > +       @sed -i -e 's|\@XEN_LIB_STORED\@|$(XEN_LIB_STORED)|g'  $@
> > > +       @sed -i -e 's|\@LIBEXEC\@|$(LIBEXEC)|g'                $@
> > > +
> > > +%.mount: %.mount.in
> > > +       cp $< $@
> > > +       @sed -i -e 's|\@SBINDIR\@|$(SBINDIR)|g'                $@
> > > +       @sed -i -e 's|\@BINDIR\@|$(BINDIR)|g'                  $@
> > > +       @sed -i -e 's|\@XEN_RUN_DIR\@|$(XEN_RUN_DIR)|g'        $@
> > > +       @sed -i -e 's|\@XEN_LOG_DIR\@|$(XEN_LOG_DIR)|g'        $@
> > > +       @sed -i -e 's|\@XEN_LIB_STORED\@|$(XEN_LIB_STORED)|g'  $@
> > > +       @sed -i -e 's|\@LIBEXEC\@|$(LIBEXEC)|g'                $@ 
> > 
> > If you do keep this then itis crying out for a helper macro/make
> > function.
> 
> Can we welcome this as an enhancement?

If not the autoconf way then I'd like to at least see this collapsed
into one instance with some make facitily or other please.

Ian.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v3 7/7] systemd: add support initial xen systemd service files
  2014-03-24 10:14     ` Ian Campbell
@ 2014-04-28 12:56       ` Luis R. Rodriguez
  0 siblings, 0 replies; 14+ messages in thread
From: Luis R. Rodriguez @ 2014-04-28 12:56 UTC (permalink / raw)
  To: Ian Campbell
  Cc: Stefano Stabellini, Jan Rękorajski, Ian Jackson,
	Jacek Konieczny, M A Young, xen-devel, Luis R. Rodriguez

On Mon, Mar 24, 2014 at 10:14:01AM +0000, Ian Campbell wrote:
> On Sat, 2014-03-22 at 03:30 +0100, Luis R. Rodriguez wrote:
> > On Fri, Mar 21, 2014 at 03:40:50PM +0000, Ian Campbell wrote:
> > > On Wed, 2014-03-19 at 14:07 -0700, Luis R. Rodriguez wrote:
> > > > As for integration with xen, we house keep all the systemd files
> > > > under a new directory tools/hotplug/Linux/systemd/ and will be
> > > > targetted
> > > > by default when building on Linux systems (CONFIG_Linux) given the low
> > > > overhead of only having to only sed the meta @VARIABLES@.
> > > 
> > > Could configure not generate these more easily than what you have below?
> > 
> > Not sure, I've dodged configure all my life.
> > 
> > > It could still be conditional on Linux I'd have though, given a little
> > > bit of autofoo ninjutsu.
> > 
> > I'm autofoo dumb.
> 
> For this case I think you just need to add the files to
> tools/configure.ac:AC_CONFIG_FILES

It was a bit more work than that but I git it and do agree
its nicer. Doing this begged for other changes to be made which
I'll roll into the series.

  Luis

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v3 7/7] systemd: add support initial xen systemd service files
  2014-03-20 22:10         ` M A Young
  2014-03-20 22:22           ` Luis R. Rodriguez
@ 2014-04-28 13:08           ` Luis R. Rodriguez
  1 sibling, 0 replies; 14+ messages in thread
From: Luis R. Rodriguez @ 2014-04-28 13:08 UTC (permalink / raw)
  To: M A Young
  Cc: Ian Campbell, Stefano Stabellini, Jan Rękorajski,
	Ian Jackson, Jacek Konieczny, xen-devel

On Thu, Mar 20, 2014 at 3:10 PM, M A Young <m.a.young@durham.ac.uk> wrote:
> You need both lines in both xenstored.service and oxenstored.service. This
> reflects this commit
> http://xenbits.xenproject.org/gitweb/?p=xen.git;a=commit;h=02ebea7768fe723deaa56c2cfcb860874544b47d
> adding the second line to the xencommons init.d scripts between xen 4.3 and
> xen 4.4 . I know from testing that you can have trouble starting guests with
> xl if you leave the second line out.


Thanks for the feedback, I've rolled this into my series.

  Luis

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2014-04-28 13:08 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-19 21:07 [PATCH v3 7/7] systemd: add support initial xen systemd service files Luis R. Rodriguez
2014-03-20 20:53 ` M A Young
2014-03-20 21:02   ` Luis R. Rodriguez
2014-03-20 21:19     ` M A Young
2014-03-20 21:50       ` Luis R. Rodriguez
2014-03-20 22:10         ` M A Young
2014-03-20 22:22           ` Luis R. Rodriguez
2014-03-21 11:16             ` Ian Jackson
2014-03-21 11:44               ` Ian Campbell
2014-04-28 13:08           ` Luis R. Rodriguez
2014-03-21 15:40 ` Ian Campbell
2014-03-22  2:30   ` Luis R. Rodriguez
2014-03-24 10:14     ` Ian Campbell
2014-04-28 12:56       ` Luis R. Rodriguez

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.