All of lore.kernel.org
 help / color / mirror / Atom feed
From: M A Young <m.a.young@durham.ac.uk>
To: Wei Liu <wei.liu2@citrix.com>
Cc: Olaf Hering <olaf@aepfle.de>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	George Dunlap <dunlapg@umich.edu>,
	Ian Jackson <ian.jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [PATCH 7/7] tools/hotplug: add wrapper to start xenstored
Date: Thu, 10 Sep 2015 16:01:06 +0100 (BST)	[thread overview]
Message-ID: <alpine.LFD.2.20.1509101559010.2475@algedi.dur.ac.uk> (raw)
In-Reply-To: <20150910145330.GC1695@zion.uk.xensource.com>

On Thu, 10 Sep 2015, Wei Liu wrote:

> On Thu, Sep 10, 2015 at 03:19:35PM +0100, George Dunlap wrote:
> > On Wed, Jan 7, 2015 at 9:40 AM, Olaf Hering <olaf@aepfle.de> wrote:
> > > On Tue, Jan 06, Ian Campbell wrote:
> > >
> > >> On Fri, 2014-12-19 at 12:25 +0100, Olaf Hering wrote:
> > >> > The shell wrapper in xenstored.service does not handle XENSTORE_TRACE.
> > >> >
> > >> > Create a separate wrapper script which is used in the sysv runlevel
> > >> > script and in systemd xenstored.service. It preserves existing
> > >> > behaviour by handling the XENSTORE_TRACE boolean. It also implements
> > >> > the handling of XENSTORED_ARGS=. This variable has to be added to
> > >> > sysconfig/xencommons.
> > >>
> > >> Why don't we just drop XENSTORED_* in favour of XENSTORED_ARGS (with an
> > >> example in the sysconfig file of enabling tracing if you like)?
> > >
> > > After having two weeks to think about this I came to the same
> > > conclusion. I think whatever the outcome is, the boolean should be
> > > removed. The sysconfig file should get a XENSTORED_ARGS="" along with a
> > > help text which mentions "-T /path" and "xenstored --help" to get other
> > > options because there is no man page.
> > >
> > >> Going to a wrapper script just to make some fairly uncommon debugging
> > >> option marginally more convenient seems like overkill to me, plus
> > >> XENSTORED_ARGS would allow for passing other useful options to
> > >> xenstored.
> > >
> > > If I recall correctly the point of the current 'sh -c "exec ..."' stunt
> > > was to expand the XENSTORE variable from the sysconfig file. But this
> > > approach leads to failures with SELinux because the socket passing does
> > > not work this way. Up to now I have not seen a success report for
> > > selinux+systemd+xenstored. Maybe its already somewhere in the other
> > > unread mails.
> > >
> > > In my cover letter I provided some possible ways to handle
> > > selinux+systemd+xenstored. Ideally the approach "Exec=/usr/bin/env
> > > $XENSTORED --no-fork $XENSTORED_ARGS" works because it means its
> > > possible to select a binary via the sysconfig file. But it also means
> > > the XENSTORE_TRACE boolean has to be removed in favour of the plain
> > > XENSTORED_ARGS= approach mentioned above. Finally this would avoid the
> > > need for a wrapper script.
> > >
> > > Hopefully someone with access to a SELinux enabled system will report
> > > which approach actually works.
> > 
> > I can confirm that
> > 
> > ExecStart=/bin/sh -c "exec $XENSTORED --no-fork $XENSTORED_ARGS"
> > 
> > does not work on a CentOS7 system with selinux enabled, but that
> > 
> > ExecStart=/usr/bin/env $XENSTORED --no-fork $XENSTORED_ARGS
> > 
> 
> And the difference between these two approaches is /usr/bin/env
> preserves envars while sh -c doesn't?

/bin/sh doesn't give the right selinux permissions so xenstored doesn't 
start. Presumably /usr/bin/env does.

	Michael Young

  reply	other threads:[~2015-09-10 15:01 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-19 11:25 [PATCH 0/7 v3] tools/hotplug: systemd changes for 4.5 Olaf Hering
2014-12-19 11:25 ` [PATCH 1/7] tools/hotplug: remove SELinux options from var-lib-xenstored.mount Olaf Hering
2015-01-06 11:27   ` Ian Campbell
2015-01-07  9:23     ` Olaf Hering
2015-01-07  9:31       ` Ian Campbell
2015-01-07 14:53         ` Konrad Rzeszutek Wilk
2015-01-06 14:48   ` Ian Jackson
2015-09-10 13:52   ` George Dunlap
2015-09-10 14:13     ` M A Young
2015-09-10 14:17       ` George Dunlap
2015-09-11  6:31     ` Olaf Hering
2015-09-14 16:30       ` George Dunlap
2015-09-14 18:33         ` Olaf Hering
2015-09-15  8:55           ` George Dunlap
2015-09-15 12:48             ` Olaf Hering
2015-09-15 12:55               ` George Dunlap
2015-09-15 13:58                 ` Konrad Rzeszutek Wilk
2015-09-15 14:01                   ` George Dunlap
2015-09-15 15:12                     ` Konrad Rzeszutek Wilk
2015-09-15 15:52                       ` George Dunlap
2015-09-15 13:57               ` Konrad Rzeszutek Wilk
2014-12-19 11:25 ` [PATCH 2/7] tools/hotplug: remove XENSTORED_ROOTDIR from xenstored.service Olaf Hering
2014-12-19 11:25 ` [PATCH 3/7] tools/hotplug: xendomains.service depends on network Olaf Hering
2014-12-19 11:25 ` [PATCH 4/7] tools/hotplug: use xencommons as EnvironmentFile in xenconsoled.service Olaf Hering
2015-01-06 11:29   ` Ian Campbell
2015-01-06 14:45   ` Ian Jackson
2014-12-19 11:25 ` [PATCH 5/7] tools/hotplug: use XENCONSOLED_TRACE " Olaf Hering
2015-01-06 11:30   ` Ian Campbell
2015-01-06 15:26     ` Konrad Rzeszutek Wilk
2015-01-06 14:46   ` Ian Jackson
2014-12-19 11:25 ` [PATCH 6/7] tools/hotplug: remove EnvironmentFile from xen-qemu-dom0-disk-backend.service Olaf Hering
2015-01-06 11:33   ` Ian Campbell
2015-01-06 14:50   ` Ian Jackson
2014-12-19 11:25 ` [PATCH 7/7] tools/hotplug: add wrapper to start xenstored Olaf Hering
2015-01-06 11:41   ` Ian Campbell
2015-01-07  9:40     ` Olaf Hering
2015-01-07 15:27       ` Ian Jackson
2015-01-07 15:42         ` Konrad Rzeszutek Wilk
2015-09-10 14:19       ` George Dunlap
2015-09-10 14:53         ` Wei Liu
2015-09-10 15:01           ` M A Young [this message]
2015-09-10 15:10             ` Wei Liu
2015-09-10 15:11             ` George Dunlap
2015-09-10 16:01           ` Ian Jackson
2015-09-11  6:42             ` Olaf Hering
2015-01-06 14:58   ` Ian Jackson
2015-01-07  9:49     ` Olaf Hering
2015-01-07 14:55       ` Konrad Rzeszutek Wilk
2014-12-19 19:10 ` [PATCH 0/7 v3] tools/hotplug: systemd changes for 4.5 Konrad Rzeszutek Wilk
2014-12-22  8:06   ` Olaf Hering
2014-12-31 15:31     ` Konrad Rzeszutek Wilk
2015-01-05 21:22       ` Konrad Rzeszutek Wilk
2015-01-06 10:05         ` Ian Campbell
2015-01-06 15:00         ` Ian Jackson
2015-01-06 15:19           ` Konrad Rzeszutek Wilk
2015-01-07  9:53         ` Olaf Hering
2015-01-07 14:56           ` Konrad Rzeszutek Wilk
2015-01-07 15:03             ` Olaf Hering

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=alpine.LFD.2.20.1509101559010.2475@algedi.dur.ac.uk \
    --to=m.a.young@durham.ac.uk \
    --cc=Ian.Campbell@citrix.com \
    --cc=dunlapg@umich.edu \
    --cc=ian.jackson@eu.citrix.com \
    --cc=olaf@aepfle.de \
    --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.