From: Olaf Hering <olaf@aepfle.de>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>,
Ian Jackson <Ian.Jackson@eu.citrix.com>,
Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
xen-devel@lists.xen.org
Subject: Re: [PATCH 5/5] tools/hotplug: support XENSTORED_TRACE in systemd
Date: Wed, 10 Dec 2014 18:52:51 +0100 [thread overview]
Message-ID: <20141210175251.GA4441@aepfle.de> (raw)
In-Reply-To: <1418205728.19809.40.camel@citrix.com>
On Wed, Dec 10, Ian Campbell wrote:
> That results in a wrapper which unconditionally execs, the systemd unit
> just calls that while the sysv script runs the wrapper and then does the
> xenstore-read -s loop.
Since systemd handles the socket there is already a listener.
http://lists.freedesktop.org/archives/systemd-devel/2014-December/026157.html
I came up with this, works in my testing with SLE11 sysv and Factory
systemd. The beef looks like shown below. Let me know if thats good
enough to handle XENSTORED_TRACE also in systemd. I will add some
comments to the wrapper why it is there.
Olaf
diff --git a/tools/hotplug/Linux/init.d/xencommons.in b/tools/hotplug/Linux/init.d/xencommons.in
index a1095c2..f57bfd3 100644
--- a/tools/hotplug/Linux/init.d/xencommons.in
+++ b/tools/hotplug/Linux/init.d/xencommons.in
@@ -66,11 +66,13 @@ do_start () {
then
test -z "$XENSTORED_ROOTDIR" && XENSTORED_ROOTDIR="@XEN_LIB_STORED@"
rm -f "$XENSTORED_ROOTDIR"/tdb* &>/dev/null
- test -z "$XENSTORED_TRACE" || XENSTORED_ARGS=" -T /var/log/xen/xenstored-trace.log"
if [ -n "$XENSTORED" ] ; then
echo -n Starting $XENSTORED...
- $XENSTORED --pid-file /var/run/xenstored.pid $XENSTORED_ARGS
+ XENSTORED=$XENSTORED \
+ XENSTORED_TRACE=$XENSTORED_TRACE \
+ XENSTORED_ARGS=$XENSTORED_ARGS \
+ ${LIBEXEC_BIN}/xenstored.sh --pid-file /var/run/xenstored.pid
else
echo "No xenstored found"
exit 1
diff --git a/tools/hotplug/Linux/systemd/xenstored.service.in b/tools/hotplug/Linux/systemd/xenstored.service.in
index 0f0ac58..d906ea2 100644
--- a/tools/hotplug/Linux/systemd/xenstored.service.in
+++ b/tools/hotplug/Linux/systemd/xenstored.service.in
@@ -8,13 +8,12 @@ ConditionPathExists=/proc/xen/capabilities
[Service]
Type=notify
-Environment=XENSTORED_ARGS=
Environment=XENSTORED=@XENSTORED@
-EnvironmentFile=-@CONFIG_DIR@/@CONFIG_LEAF_DIR@/xencommons
+EnvironmentFile=@CONFIG_DIR@/@CONFIG_LEAF_DIR@/xencommons
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=/bin/sh -c "exec $XENSTORED --no-fork $XENSTORED_ARGS"
+ExecStart=-@LIBEXEC_BIN@/xenstored.sh --no-fork
[Install]
WantedBy=multi-user.target
diff --git a/tools/hotplug/Linux/xenstored.sh.in b/tools/hotplug/Linux/xenstored.sh.in
new file mode 100644
index 0000000..dc806ee
--- /dev/null
+++ b/tools/hotplug/Linux/xenstored.sh.in
@@ -0,0 +1,6 @@
+#!/bin/sh
+if test -n "$XENSTORED_TRACE"
+then
+ XENSTORED_ARGS=" -T /var/log/xen/xenstored-trace.log"
+fi
+exec $XENSTORED $@ $XENSTORED_ARGS
next prev parent reply other threads:[~2014-12-10 17:52 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-05 12:05 [PATCH 0/5] tools/hotplug: systemd changes for 4.5 Olaf Hering
2014-12-05 12:05 ` [PATCH 1/5] tools/hotplug: move XENSTORED_MOUNT_CTX to sysconfig.xencommons Olaf Hering
2014-12-05 12:20 ` Ian Jackson
2014-12-05 12:26 ` Olaf Hering
2014-12-05 12:32 ` Olaf Hering
2014-12-05 12:43 ` Ian Jackson
2014-12-05 13:27 ` Olaf Hering
2014-12-05 15:01 ` Ian Jackson
2014-12-05 15:35 ` Anthony PERARD
2014-12-05 15:51 ` Olaf Hering
2014-12-05 16:09 ` Anthony PERARD
2014-12-05 12:05 ` [PATCH 2/5] tools/hotplug: use existing sysconfig file for xenconsoled Olaf Hering
2014-12-05 12:05 ` [PATCH 3/5] tools/hotplug: remove EnvironmentFile from xen-qemu-dom0-disk-backend.service Olaf Hering
2014-12-05 12:05 ` [PATCH 4/5] tools/hotplug: remove XENSTORED_ROOTDIR from service file Olaf Hering
2014-12-05 12:21 ` Ian Jackson
2014-12-05 12:05 ` [PATCH 5/5] tools/hotplug: support XENSTORED_TRACE in systemd Olaf Hering
2014-12-05 12:24 ` Ian Jackson
2014-12-05 12:30 ` Olaf Hering
2014-12-05 12:51 ` Ian Jackson
2014-12-05 13:31 ` Olaf Hering
2014-12-08 12:37 ` Olaf Hering
2014-12-09 16:09 ` Ian Jackson
2014-12-09 16:27 ` Olaf Hering
2014-12-09 16:46 ` Ian Jackson
2014-12-10 9:15 ` Olaf Hering
2014-12-10 10:02 ` Ian Campbell
2014-12-10 10:08 ` Olaf Hering
2014-12-10 17:52 ` Olaf Hering [this message]
2014-12-12 10:10 ` Ian Campbell
2014-12-12 11:37 ` Olaf Hering
2014-12-12 11:47 ` Ian Campbell
2014-12-12 12:08 ` M A Young
2014-12-12 12:12 ` Olaf Hering
2014-12-12 15:06 ` Olaf Hering
2014-12-10 18:01 ` Olaf Hering
2014-12-12 10:07 ` Ian Campbell
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=20141210175251.GA4441@aepfle.de \
--to=olaf@aepfle.de \
--cc=Ian.Campbell@citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xen.org \
/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.