All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tools/hotplug: update systemd dependency to use service instead of socket
@ 2014-12-02 15:39 Olaf Hering
  2014-12-02 15:44 ` Ian Campbell
  2014-12-03  9:52 ` Olaf Hering
  0 siblings, 2 replies; 16+ messages in thread
From: Olaf Hering @ 2014-12-02 15:39 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Wei Liu, Ian Campbell, Stefano Stabellini, Ian Jackson

Since commit 4542ae340d75bd6319e3fcd94e6c9336e210aeef ("tools/hotplug:
systemd xenstored dependencies") all service files use the .socket unit
as startup dependency. While this happens to work for boot it fails for
shutdown because a .socket does not seem to enforce ordering. When
xendomains.service runs during shutdown then systemd will stop
xenstored.service at the same time.

Change all "xenstored.socket" to "xenstored.service" to let systemd know
that xenstored has to be shutdown after everything else.

Reported-by: Mark Pryor <tlviewer@yahoo.com>
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
---

This should go into 4.5 to fix xendomains.service.

 tools/hotplug/Linux/systemd/xen-init-dom0.service.in              | 4 ++--
 tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in | 4 ++--
 tools/hotplug/Linux/systemd/xenconsoled.service.in                | 4 ++--
 tools/hotplug/Linux/systemd/xendomains.service.in                 | 4 ++--
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/tools/hotplug/Linux/systemd/xen-init-dom0.service.in b/tools/hotplug/Linux/systemd/xen-init-dom0.service.in
index 4d4cb23..3befadc 100644
--- a/tools/hotplug/Linux/systemd/xen-init-dom0.service.in
+++ b/tools/hotplug/Linux/systemd/xen-init-dom0.service.in
@@ -1,7 +1,7 @@
 [Unit]
 Description=xen-init-dom0, initialise Dom0 configuration (xenstore nodes, JSON configuration stub)
-Requires=xenstored.socket proc-xen.mount
-After=xenstored.socket proc-xen.mount
+Requires=xenstored.service proc-xen.mount
+After=xenstored.service proc-xen.mount
 ConditionPathExists=/proc/xen/capabilities
 
 [Service]
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
index 6b9c96e..0a5807a 100644
--- a/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in
+++ b/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in
@@ -1,7 +1,7 @@
 [Unit]
 Description=qemu for xen dom0 disk backend
-Requires=proc-xen.mount xenstored.socket
-After=proc-xen.mount xenstored.socket xenconsoled.service
+Requires=proc-xen.mount xenstored.service
+After=proc-xen.mount xenstored.service xenconsoled.service
 Before=xendomains.service libvirtd.service libvirt-guests.service
 RefuseManualStop=true
 ConditionPathExists=/proc/xen/capabilities
diff --git a/tools/hotplug/Linux/systemd/xenconsoled.service.in b/tools/hotplug/Linux/systemd/xenconsoled.service.in
index 2c5d99f..cb44cd6 100644
--- a/tools/hotplug/Linux/systemd/xenconsoled.service.in
+++ b/tools/hotplug/Linux/systemd/xenconsoled.service.in
@@ -1,7 +1,7 @@
 [Unit]
 Description=Xenconsoled - handles logging from guest consoles and hypervisor
-Requires=proc-xen.mount xenstored.socket
-After=proc-xen.mount xenstored.socket
+Requires=proc-xen.mount xenstored.service
+After=proc-xen.mount xenstored.service
 ConditionPathExists=/proc/xen/capabilities
 
 [Service]
diff --git a/tools/hotplug/Linux/systemd/xendomains.service.in b/tools/hotplug/Linux/systemd/xendomains.service.in
index 757278f..9962671 100644
--- a/tools/hotplug/Linux/systemd/xendomains.service.in
+++ b/tools/hotplug/Linux/systemd/xendomains.service.in
@@ -1,7 +1,7 @@
 [Unit]
 Description=Xendomains - start and stop guests on boot and shutdown
-Requires=proc-xen.mount xenstored.socket
-After=proc-xen.mount xenstored.socket xenconsoled.service xen-init-dom0.service
+Requires=proc-xen.mount xenstored.service
+After=proc-xen.mount xenstored.service xenconsoled.service xen-init-dom0.service
 ConditionPathExists=/proc/xen/capabilities
 
 [Service]

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

* Re: [PATCH] tools/hotplug: update systemd dependency to use service instead of socket
  2014-12-02 15:39 [PATCH] tools/hotplug: update systemd dependency to use service instead of socket Olaf Hering
@ 2014-12-02 15:44 ` Ian Campbell
  2014-12-02 18:42   ` Konrad Rzeszutek Wilk
  2014-12-03  9:52 ` Olaf Hering
  1 sibling, 1 reply; 16+ messages in thread
From: Ian Campbell @ 2014-12-02 15:44 UTC (permalink / raw)
  To: Olaf Hering, Konrad Rzeszutek Wilk
  Cc: Ian Jackson, Stefano Stabellini, Wei Liu, xen-devel

On Tue, 2014-12-02 at 16:39 +0100, Olaf Hering wrote:
> Since commit 4542ae340d75bd6319e3fcd94e6c9336e210aeef ("tools/hotplug:
> systemd xenstored dependencies") all service files use the .socket unit
> as startup dependency. While this happens to work for boot it fails for
> shutdown because a .socket does not seem to enforce ordering. When
> xendomains.service runs during shutdown then systemd will stop
> xenstored.service at the same time.
> 
> Change all "xenstored.socket" to "xenstored.service" to let systemd know
> that xenstored has to be shutdown after everything else.
> 
> Reported-by: Mark Pryor <tlviewer@yahoo.com>
> Signed-off-by: Olaf Hering <olaf@aepfle.de>
> Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

Acked-by: Ian Campbell <ian.campbell@citrix.com>

> Cc: Wei Liu <wei.liu2@citrix.com>
> ---
> 
> This should go into 4.5 to fix xendomains.service.

CCing Konrad...

> 
>  tools/hotplug/Linux/systemd/xen-init-dom0.service.in              | 4 ++--
>  tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in | 4 ++--
>  tools/hotplug/Linux/systemd/xenconsoled.service.in                | 4 ++--
>  tools/hotplug/Linux/systemd/xendomains.service.in                 | 4 ++--
>  4 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/tools/hotplug/Linux/systemd/xen-init-dom0.service.in b/tools/hotplug/Linux/systemd/xen-init-dom0.service.in
> index 4d4cb23..3befadc 100644
> --- a/tools/hotplug/Linux/systemd/xen-init-dom0.service.in
> +++ b/tools/hotplug/Linux/systemd/xen-init-dom0.service.in
> @@ -1,7 +1,7 @@
>  [Unit]
>  Description=xen-init-dom0, initialise Dom0 configuration (xenstore nodes, JSON configuration stub)
> -Requires=xenstored.socket proc-xen.mount
> -After=xenstored.socket proc-xen.mount
> +Requires=xenstored.service proc-xen.mount
> +After=xenstored.service proc-xen.mount
>  ConditionPathExists=/proc/xen/capabilities
>  
>  [Service]
> 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
> index 6b9c96e..0a5807a 100644
> --- a/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in
> +++ b/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in
> @@ -1,7 +1,7 @@
>  [Unit]
>  Description=qemu for xen dom0 disk backend
> -Requires=proc-xen.mount xenstored.socket
> -After=proc-xen.mount xenstored.socket xenconsoled.service
> +Requires=proc-xen.mount xenstored.service
> +After=proc-xen.mount xenstored.service xenconsoled.service
>  Before=xendomains.service libvirtd.service libvirt-guests.service
>  RefuseManualStop=true
>  ConditionPathExists=/proc/xen/capabilities
> diff --git a/tools/hotplug/Linux/systemd/xenconsoled.service.in b/tools/hotplug/Linux/systemd/xenconsoled.service.in
> index 2c5d99f..cb44cd6 100644
> --- a/tools/hotplug/Linux/systemd/xenconsoled.service.in
> +++ b/tools/hotplug/Linux/systemd/xenconsoled.service.in
> @@ -1,7 +1,7 @@
>  [Unit]
>  Description=Xenconsoled - handles logging from guest consoles and hypervisor
> -Requires=proc-xen.mount xenstored.socket
> -After=proc-xen.mount xenstored.socket
> +Requires=proc-xen.mount xenstored.service
> +After=proc-xen.mount xenstored.service
>  ConditionPathExists=/proc/xen/capabilities
>  
>  [Service]
> diff --git a/tools/hotplug/Linux/systemd/xendomains.service.in b/tools/hotplug/Linux/systemd/xendomains.service.in
> index 757278f..9962671 100644
> --- a/tools/hotplug/Linux/systemd/xendomains.service.in
> +++ b/tools/hotplug/Linux/systemd/xendomains.service.in
> @@ -1,7 +1,7 @@
>  [Unit]
>  Description=Xendomains - start and stop guests on boot and shutdown
> -Requires=proc-xen.mount xenstored.socket
> -After=proc-xen.mount xenstored.socket xenconsoled.service xen-init-dom0.service
> +Requires=proc-xen.mount xenstored.service
> +After=proc-xen.mount xenstored.service xenconsoled.service xen-init-dom0.service
>  ConditionPathExists=/proc/xen/capabilities
>  
>  [Service]
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

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

* Re: [PATCH] tools/hotplug: update systemd dependency to use service instead of socket
  2014-12-02 15:44 ` Ian Campbell
@ 2014-12-02 18:42   ` Konrad Rzeszutek Wilk
  2014-12-02 18:51     ` M A Young
  0 siblings, 1 reply; 16+ messages in thread
From: Konrad Rzeszutek Wilk @ 2014-12-02 18:42 UTC (permalink / raw)
  To: Ian Campbell, m.a.young
  Cc: Ian Jackson, Olaf Hering, Stefano Stabellini, Wei Liu, xen-devel

On Tue, Dec 02, 2014 at 03:44:55PM +0000, Ian Campbell wrote:
> On Tue, 2014-12-02 at 16:39 +0100, Olaf Hering wrote:
> > Since commit 4542ae340d75bd6319e3fcd94e6c9336e210aeef ("tools/hotplug:
> > systemd xenstored dependencies") all service files use the .socket unit
> > as startup dependency. While this happens to work for boot it fails for
> > shutdown because a .socket does not seem to enforce ordering. When
> > xendomains.service runs during shutdown then systemd will stop
> > xenstored.service at the same time.
> > 
> > Change all "xenstored.socket" to "xenstored.service" to let systemd know
> > that xenstored has to be shutdown after everything else.
> > 
> > Reported-by: Mark Pryor <tlviewer@yahoo.com>
> > Signed-off-by: Olaf Hering <olaf@aepfle.de>
> > Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> > Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> 
> Acked-by: Ian Campbell <ian.campbell@citrix.com>
> 
> > Cc: Wei Liu <wei.liu2@citrix.com>
> > ---
> > 
> > This should go into 4.5 to fix xendomains.service.
> 
> CCing Konrad...

CC-ing Michael.

Michael, since Fedora is using systemd, did you observe this bug as well?
(I think I did, but I might have blamed it on my wacky setup).

> 
> > 
> >  tools/hotplug/Linux/systemd/xen-init-dom0.service.in              | 4 ++--
> >  tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in | 4 ++--
> >  tools/hotplug/Linux/systemd/xenconsoled.service.in                | 4 ++--
> >  tools/hotplug/Linux/systemd/xendomains.service.in                 | 4 ++--
> >  4 files changed, 8 insertions(+), 8 deletions(-)
> > 
> > diff --git a/tools/hotplug/Linux/systemd/xen-init-dom0.service.in b/tools/hotplug/Linux/systemd/xen-init-dom0.service.in
> > index 4d4cb23..3befadc 100644
> > --- a/tools/hotplug/Linux/systemd/xen-init-dom0.service.in
> > +++ b/tools/hotplug/Linux/systemd/xen-init-dom0.service.in
> > @@ -1,7 +1,7 @@
> >  [Unit]
> >  Description=xen-init-dom0, initialise Dom0 configuration (xenstore nodes, JSON configuration stub)
> > -Requires=xenstored.socket proc-xen.mount
> > -After=xenstored.socket proc-xen.mount
> > +Requires=xenstored.service proc-xen.mount
> > +After=xenstored.service proc-xen.mount
> >  ConditionPathExists=/proc/xen/capabilities
> >  
> >  [Service]
> > 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
> > index 6b9c96e..0a5807a 100644
> > --- a/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in
> > +++ b/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in
> > @@ -1,7 +1,7 @@
> >  [Unit]
> >  Description=qemu for xen dom0 disk backend
> > -Requires=proc-xen.mount xenstored.socket
> > -After=proc-xen.mount xenstored.socket xenconsoled.service
> > +Requires=proc-xen.mount xenstored.service
> > +After=proc-xen.mount xenstored.service xenconsoled.service
> >  Before=xendomains.service libvirtd.service libvirt-guests.service
> >  RefuseManualStop=true
> >  ConditionPathExists=/proc/xen/capabilities
> > diff --git a/tools/hotplug/Linux/systemd/xenconsoled.service.in b/tools/hotplug/Linux/systemd/xenconsoled.service.in
> > index 2c5d99f..cb44cd6 100644
> > --- a/tools/hotplug/Linux/systemd/xenconsoled.service.in
> > +++ b/tools/hotplug/Linux/systemd/xenconsoled.service.in
> > @@ -1,7 +1,7 @@
> >  [Unit]
> >  Description=Xenconsoled - handles logging from guest consoles and hypervisor
> > -Requires=proc-xen.mount xenstored.socket
> > -After=proc-xen.mount xenstored.socket
> > +Requires=proc-xen.mount xenstored.service
> > +After=proc-xen.mount xenstored.service
> >  ConditionPathExists=/proc/xen/capabilities
> >  
> >  [Service]
> > diff --git a/tools/hotplug/Linux/systemd/xendomains.service.in b/tools/hotplug/Linux/systemd/xendomains.service.in
> > index 757278f..9962671 100644
> > --- a/tools/hotplug/Linux/systemd/xendomains.service.in
> > +++ b/tools/hotplug/Linux/systemd/xendomains.service.in
> > @@ -1,7 +1,7 @@
> >  [Unit]
> >  Description=Xendomains - start and stop guests on boot and shutdown
> > -Requires=proc-xen.mount xenstored.socket
> > -After=proc-xen.mount xenstored.socket xenconsoled.service xen-init-dom0.service
> > +Requires=proc-xen.mount xenstored.service
> > +After=proc-xen.mount xenstored.service xenconsoled.service xen-init-dom0.service
> >  ConditionPathExists=/proc/xen/capabilities
> >  
> >  [Service]
> > 
> > _______________________________________________
> > Xen-devel mailing list
> > Xen-devel@lists.xen.org
> > http://lists.xen.org/xen-devel
> 
> 

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

* Re: [PATCH] tools/hotplug: update systemd dependency to use service instead of socket
  2014-12-02 18:42   ` Konrad Rzeszutek Wilk
@ 2014-12-02 18:51     ` M A Young
  2014-12-02 20:42       ` Konrad Rzeszutek Wilk
  2014-12-03 16:54       ` Konrad Rzeszutek Wilk
  0 siblings, 2 replies; 16+ messages in thread
From: M A Young @ 2014-12-02 18:51 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk
  Cc: Olaf Hering, Wei Liu, Ian Campbell, Stefano Stabellini,
	Ian Jackson, xen-devel

On Tue, 2 Dec 2014, Konrad Rzeszutek Wilk wrote:

> On Tue, Dec 02, 2014 at 03:44:55PM +0000, Ian Campbell wrote:
>> On Tue, 2014-12-02 at 16:39 +0100, Olaf Hering wrote:
>>> Since commit 4542ae340d75bd6319e3fcd94e6c9336e210aeef ("tools/hotplug:
>>> systemd xenstored dependencies") all service files use the .socket unit
>>> as startup dependency. While this happens to work for boot it fails for
>>> shutdown because a .socket does not seem to enforce ordering. When
>>> xendomains.service runs during shutdown then systemd will stop
>>> xenstored.service at the same time.
>>>
>>> Change all "xenstored.socket" to "xenstored.service" to let systemd know
>>> that xenstored has to be shutdown after everything else.
>>>
>>> Reported-by: Mark Pryor <tlviewer@yahoo.com>
>>> Signed-off-by: Olaf Hering <olaf@aepfle.de>
>>> Cc: Ian Jackson <ian.jackson@eu.citrix.com>
>>> Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
>>
>> Acked-by: Ian Campbell <ian.campbell@citrix.com>
>>
>>> Cc: Wei Liu <wei.liu2@citrix.com>
>>> ---
>>>
>>> This should go into 4.5 to fix xendomains.service.
>>
>> CCing Konrad...
>
> CC-ing Michael.
>
> Michael, since Fedora is using systemd, did you observe this bug as well?
> (I think I did, but I might have blamed it on my wacky setup).

I only tried the xen systemd on xen 4.5-rc2 and didn't have a lot of 
success even when I reverted to Fedora's systemd for xen, so I can't 
really comment. I did have issues with xen systemd which I shall report if 
they are still there in -rc3.

 	Michael Young

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

* Re: [PATCH] tools/hotplug: update systemd dependency to use service instead of socket
  2014-12-02 18:51     ` M A Young
@ 2014-12-02 20:42       ` Konrad Rzeszutek Wilk
  2014-12-04 13:25         ` Ian Campbell
  2014-12-03 16:54       ` Konrad Rzeszutek Wilk
  1 sibling, 1 reply; 16+ messages in thread
From: Konrad Rzeszutek Wilk @ 2014-12-02 20:42 UTC (permalink / raw)
  To: M A Young
  Cc: Olaf Hering, Wei Liu, Ian Campbell, Stefano Stabellini,
	Ian Jackson, xen-devel

On Tue, Dec 02, 2014 at 06:51:50PM +0000, M A Young wrote:
> On Tue, 2 Dec 2014, Konrad Rzeszutek Wilk wrote:
> 
> >On Tue, Dec 02, 2014 at 03:44:55PM +0000, Ian Campbell wrote:
> >>On Tue, 2014-12-02 at 16:39 +0100, Olaf Hering wrote:
> >>>Since commit 4542ae340d75bd6319e3fcd94e6c9336e210aeef ("tools/hotplug:
> >>>systemd xenstored dependencies") all service files use the .socket unit
> >>>as startup dependency. While this happens to work for boot it fails for
> >>>shutdown because a .socket does not seem to enforce ordering. When
> >>>xendomains.service runs during shutdown then systemd will stop
> >>>xenstored.service at the same time.
> >>>
> >>>Change all "xenstored.socket" to "xenstored.service" to let systemd know
> >>>that xenstored has to be shutdown after everything else.
> >>>
> >>>Reported-by: Mark Pryor <tlviewer@yahoo.com>
> >>>Signed-off-by: Olaf Hering <olaf@aepfle.de>
> >>>Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> >>>Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> >>
> >>Acked-by: Ian Campbell <ian.campbell@citrix.com>
> >>
> >>>Cc: Wei Liu <wei.liu2@citrix.com>
> >>>---
> >>>
> >>>This should go into 4.5 to fix xendomains.service.
> >>
> >>CCing Konrad...
> >
> >CC-ing Michael.
> >
> >Michael, since Fedora is using systemd, did you observe this bug as well?
> >(I think I did, but I might have blamed it on my wacky setup).
> 
> I only tried the xen systemd on xen 4.5-rc2 and didn't have a lot of success
> even when I reverted to Fedora's systemd for xen, so I can't really comment.

Ugh.
> I did have issues with xen systemd which I shall report if they are still
> there in -rc3.

OK, lets then go with this.

Release-Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> 
> 	Michael Young

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

* Re: [PATCH] tools/hotplug: update systemd dependency to use service instead of socket
  2014-12-02 15:39 [PATCH] tools/hotplug: update systemd dependency to use service instead of socket Olaf Hering
  2014-12-02 15:44 ` Ian Campbell
@ 2014-12-03  9:52 ` Olaf Hering
  1 sibling, 0 replies; 16+ messages in thread
From: Olaf Hering @ 2014-12-03  9:52 UTC (permalink / raw)
  To: xen-devel; +Cc: Wei Liu, Stefano Stabellini, Ian Jackson, Ian Campbell

On Tue, Dec 02, Olaf Hering wrote:

> Since commit 4542ae340d75bd6319e3fcd94e6c9336e210aeef ("tools/hotplug:
> systemd xenstored dependencies") all service files use the .socket unit
> as startup dependency. While this happens to work for boot it fails for
> shutdown because a .socket does not seem to enforce ordering. When
> xendomains.service runs during shutdown then systemd will stop
> xenstored.service at the same time.
> 
> Change all "xenstored.socket" to "xenstored.service" to let systemd know
> that xenstored has to be shutdown after everything else.
> 
> Reported-by: Mark Pryor <tlviewer@yahoo.com>
> Signed-off-by: Olaf Hering <olaf@aepfle.de>
> Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> Cc: Ian Campbell <ian.campbell@citrix.com>
> Cc: Wei Liu <wei.liu2@citrix.com>

Tested-by: Olaf Hering <olaf@aepfle.de>

I was able to reproduce the hang on shutdown with openSUSE 13.1. This
patch fixes the hang.

Olaf

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

* Re: [PATCH] tools/hotplug: update systemd dependency to use service instead of socket
  2014-12-02 18:51     ` M A Young
  2014-12-02 20:42       ` Konrad Rzeszutek Wilk
@ 2014-12-03 16:54       ` Konrad Rzeszutek Wilk
  2014-12-03 21:11         ` M A Young
  1 sibling, 1 reply; 16+ messages in thread
From: Konrad Rzeszutek Wilk @ 2014-12-03 16:54 UTC (permalink / raw)
  To: M A Young
  Cc: Olaf Hering, Wei Liu, Ian Campbell, Stefano Stabellini,
	Ian Jackson, xen-devel

On Tue, Dec 02, 2014 at 06:51:50PM +0000, M A Young wrote:
> On Tue, 2 Dec 2014, Konrad Rzeszutek Wilk wrote:
> 
> >On Tue, Dec 02, 2014 at 03:44:55PM +0000, Ian Campbell wrote:
> >>On Tue, 2014-12-02 at 16:39 +0100, Olaf Hering wrote:
> >>>Since commit 4542ae340d75bd6319e3fcd94e6c9336e210aeef ("tools/hotplug:
> >>>systemd xenstored dependencies") all service files use the .socket unit
> >>>as startup dependency. While this happens to work for boot it fails for
> >>>shutdown because a .socket does not seem to enforce ordering. When
> >>>xendomains.service runs during shutdown then systemd will stop
> >>>xenstored.service at the same time.
> >>>
> >>>Change all "xenstored.socket" to "xenstored.service" to let systemd know
> >>>that xenstored has to be shutdown after everything else.
> >>>
> >>>Reported-by: Mark Pryor <tlviewer@yahoo.com>
> >>>Signed-off-by: Olaf Hering <olaf@aepfle.de>
> >>>Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> >>>Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> >>
> >>Acked-by: Ian Campbell <ian.campbell@citrix.com>
> >>
> >>>Cc: Wei Liu <wei.liu2@citrix.com>
> >>>---
> >>>
> >>>This should go into 4.5 to fix xendomains.service.
> >>
> >>CCing Konrad...
> >
> >CC-ing Michael.
> >
> >Michael, since Fedora is using systemd, did you observe this bug as well?
> >(I think I did, but I might have blamed it on my wacky setup).
> 
> I only tried the xen systemd on xen 4.5-rc2 and didn't have a lot of success
> even when I reverted to Fedora's systemd for xen, so I can't really comment.
> I did have issues with xen systemd which I shall report if they are still
> there in -rc3.

It seems that hte issue I am having is:

ELinux: security_context_to_sid($XENSTORED_MOUNT_CTX) failed for (dev tmpfs, type tmpfs) er
Dec 03 11:46:07 laptop.dumpdata.com systemd[1]: var-lib-xenstored.mount mount process exited, code=exited status=32
Dec 03 11:46:07 laptop.dumpdata.com systemd[1]: Failed to mount mount xenstore file system.

Which looks like so:

[root@laptop system]# more var-lib-xenstored.mount 
[Unit]
Description=mount xenstore file system
Requires=proc-xen.mount
After=proc-xen.mount
ConditionPathExists=/proc/xen/capabilities
RefuseManualStop=true

[Mount]
Environment=XENSTORED_MOUNT_CTX=none
EnvironmentFile=-/etc/sysconfig/xenstored
What=xenstore
Where=/var/lib/xenstored
Type=tmpfs
Options=mode=755,context="$XENSTORED_MOUNT_CTX"


There is no /etc/sysconfig/xenstored (there is an oxenstored.conf)

If I alter it:

Options=mode=755
#,context="$XENSTORED_MOUNT_CTX"

It starts.
> 
> 	Michael Young

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

* Re: [PATCH] tools/hotplug: update systemd dependency to use service instead of socket
  2014-12-03 16:54       ` Konrad Rzeszutek Wilk
@ 2014-12-03 21:11         ` M A Young
  2014-12-04  7:47           ` Olaf Hering
  0 siblings, 1 reply; 16+ messages in thread
From: M A Young @ 2014-12-03 21:11 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk
  Cc: Olaf Hering, Wei Liu, Ian Campbell, Stefano Stabellini,
	Ian Jackson, xen-devel



On Wed, 3 Dec 2014, Konrad Rzeszutek Wilk wrote:

> On Tue, Dec 02, 2014 at 06:51:50PM +0000, M A Young wrote:
>> On Tue, 2 Dec 2014, Konrad Rzeszutek Wilk wrote:
>>
>>> On Tue, Dec 02, 2014 at 03:44:55PM +0000, Ian Campbell wrote:
>>>> On Tue, 2014-12-02 at 16:39 +0100, Olaf Hering wrote:
>>>>> Since commit 4542ae340d75bd6319e3fcd94e6c9336e210aeef ("tools/hotplug:
>>>>> systemd xenstored dependencies") all service files use the .socket unit
>>>>> as startup dependency. While this happens to work for boot it fails for
>>>>> shutdown because a .socket does not seem to enforce ordering. When
>>>>> xendomains.service runs during shutdown then systemd will stop
>>>>> xenstored.service at the same time.
>>>>>
>>>>> Change all "xenstored.socket" to "xenstored.service" to let systemd know
>>>>> that xenstored has to be shutdown after everything else.
>>>>>
>>>>> Reported-by: Mark Pryor <tlviewer@yahoo.com>
>>>>> Signed-off-by: Olaf Hering <olaf@aepfle.de>
>>>>> Cc: Ian Jackson <ian.jackson@eu.citrix.com>
>>>>> Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
>>>>
>>>> Acked-by: Ian Campbell <ian.campbell@citrix.com>
>>>>
>>>>> Cc: Wei Liu <wei.liu2@citrix.com>
>>>>> ---
>>>>>
>>>>> This should go into 4.5 to fix xendomains.service.
>>>>
>>>> CCing Konrad...
>>>
>>> CC-ing Michael.
>>>
>>> Michael, since Fedora is using systemd, did you observe this bug as well?
>>> (I think I did, but I might have blamed it on my wacky setup).
>>
>> I only tried the xen systemd on xen 4.5-rc2 and didn't have a lot of success
>> even when I reverted to Fedora's systemd for xen, so I can't really comment.
>> I did have issues with xen systemd which I shall report if they are still
>> there in -rc3.
>
> It seems that hte issue I am having is:
>
> ELinux: security_context_to_sid($XENSTORED_MOUNT_CTX) failed for (dev tmpfs, type tmpfs) er
> Dec 03 11:46:07 laptop.dumpdata.com systemd[1]: var-lib-xenstored.mount mount process exited, code=exited status=32
> Dec 03 11:46:07 laptop.dumpdata.com systemd[1]: Failed to mount mount xenstore file system.
>
> Which looks like so:
>
> [root@laptop system]# more var-lib-xenstored.mount
> [Unit]
> Description=mount xenstore file system
> Requires=proc-xen.mount
> After=proc-xen.mount
> ConditionPathExists=/proc/xen/capabilities
> RefuseManualStop=true
>
> [Mount]
> Environment=XENSTORED_MOUNT_CTX=none
> EnvironmentFile=-/etc/sysconfig/xenstored
> What=xenstore
> Where=/var/lib/xenstored
> Type=tmpfs
> Options=mode=755,context="$XENSTORED_MOUNT_CTX"

Yes, that was on my probable bug list, as context="none" isn't a valid 
mount option (on Fedora at least), presumably because context has to be 
followed by a valid selinux context.

 	Michael Young

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

* Re: [PATCH] tools/hotplug: update systemd dependency to use service instead of socket
  2014-12-03 21:11         ` M A Young
@ 2014-12-04  7:47           ` Olaf Hering
  2014-12-05  2:15             ` Konrad Rzeszutek Wilk
  0 siblings, 1 reply; 16+ messages in thread
From: Olaf Hering @ 2014-12-04  7:47 UTC (permalink / raw)
  To: M A Young
  Cc: Wei Liu, Ian Campbell, Stefano Stabellini, Ian Jackson, xen-devel

On Wed, Dec 03, M A Young wrote:

> On Wed, 3 Dec 2014, Konrad Rzeszutek Wilk wrote:
> >Options=mode=755,context="$XENSTORED_MOUNT_CTX"
> 
> Yes, that was on my probable bug list, as context="none" isn't a valid mount
> option (on Fedora at least), presumably because context has to be followed
> by a valid selinux context.

Is that something the sysadmin has to adjust, or should the xen source
provide proper values?

Olaf

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

* Re: [PATCH] tools/hotplug: update systemd dependency to use service instead of socket
  2014-12-02 20:42       ` Konrad Rzeszutek Wilk
@ 2014-12-04 13:25         ` Ian Campbell
  0 siblings, 0 replies; 16+ messages in thread
From: Ian Campbell @ 2014-12-04 13:25 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk
  Cc: Olaf Hering, Wei Liu, Stefano Stabellini, Ian Jackson, xen-devel,
	M A Young

On Tue, 2014-12-02 at 15:42 -0500, Konrad Rzeszutek Wilk wrote:
> On Tue, Dec 02, 2014 at 06:51:50PM +0000, M A Young wrote:
> > On Tue, 2 Dec 2014, Konrad Rzeszutek Wilk wrote:
> > 
> > >On Tue, Dec 02, 2014 at 03:44:55PM +0000, Ian Campbell wrote:
> > >>On Tue, 2014-12-02 at 16:39 +0100, Olaf Hering wrote:
> > >>>Since commit 4542ae340d75bd6319e3fcd94e6c9336e210aeef ("tools/hotplug:
> > >>>systemd xenstored dependencies") all service files use the .socket unit
> > >>>as startup dependency. While this happens to work for boot it fails for
> > >>>shutdown because a .socket does not seem to enforce ordering. When
> > >>>xendomains.service runs during shutdown then systemd will stop
> > >>>xenstored.service at the same time.
> > >>>
> > >>>Change all "xenstored.socket" to "xenstored.service" to let systemd know
> > >>>that xenstored has to be shutdown after everything else.
> > >>>
> > >>>Reported-by: Mark Pryor <tlviewer@yahoo.com>
> > >>>Signed-off-by: Olaf Hering <olaf@aepfle.de>
> > >>>Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> > >>>Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> > >>
> > >>Acked-by: Ian Campbell <ian.campbell@citrix.com>
> > >>
> > >>>Cc: Wei Liu <wei.liu2@citrix.com>
> > >>>---
> > >>>
> > >>>This should go into 4.5 to fix xendomains.service.
> > >>
> > >>CCing Konrad...
> > >
> > >CC-ing Michael.
> > >
> > >Michael, since Fedora is using systemd, did you observe this bug as well?
> > >(I think I did, but I might have blamed it on my wacky setup).
> > 
> > I only tried the xen systemd on xen 4.5-rc2 and didn't have a lot of success
> > even when I reverted to Fedora's systemd for xen, so I can't really comment.
> 
> Ugh.
> > I did have issues with xen systemd which I shall report if they are still
> > there in -rc3.
> 
> OK, lets then go with this.
> 
> Release-Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

Applied, thanks.

> > 
> > 	Michael Young

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

* Re: [PATCH] tools/hotplug: update systemd dependency to use service instead of socket
  2014-12-04  7:47           ` Olaf Hering
@ 2014-12-05  2:15             ` Konrad Rzeszutek Wilk
  2014-12-05  7:47               ` Olaf Hering
  0 siblings, 1 reply; 16+ messages in thread
From: Konrad Rzeszutek Wilk @ 2014-12-05  2:15 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Wei Liu, Ian Campbell, Stefano Stabellini, Ian Jackson,
	xen-devel, M A Young

On Thu, Dec 04, 2014 at 08:47:56AM +0100, Olaf Hering wrote:
> On Wed, Dec 03, M A Young wrote:
> 
> > On Wed, 3 Dec 2014, Konrad Rzeszutek Wilk wrote:
> > >Options=mode=755,context="$XENSTORED_MOUNT_CTX"
> > 
> > Yes, that was on my probable bug list, as context="none" isn't a valid mount
> > option (on Fedora at least), presumably because context has to be followed
> > by a valid selinux context.
> 
> Is that something the sysadmin has to adjust, or should the xen source
> provide proper values?

It would be rather cumbersome if the sysadmin had to adjust it. The goal
here would be that distros could use it and package it neatly so that it
works out of the box.

What are the proper values in SuSE?
> 
> Olaf
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

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

* Re: [PATCH] tools/hotplug: update systemd dependency to use service instead of socket
  2014-12-05  2:15             ` Konrad Rzeszutek Wilk
@ 2014-12-05  7:47               ` Olaf Hering
  2014-12-05  8:03                 ` Olaf Hering
  0 siblings, 1 reply; 16+ messages in thread
From: Olaf Hering @ 2014-12-05  7:47 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk
  Cc: Wei Liu, Ian Campbell, Stefano Stabellini, Ian Jackson,
	xen-devel, M A Young

On Thu, Dec 04, Konrad Rzeszutek Wilk wrote:

> On Thu, Dec 04, 2014 at 08:47:56AM +0100, Olaf Hering wrote:
> > Is that something the sysadmin has to adjust, or should the xen source
> > provide proper values?
> It would be rather cumbersome if the sysadmin had to adjust it. The goal
> here would be that distros could use it and package it neatly so that it
> works out of the box.
> 
> What are the proper values in SuSE?

I have no idea, we dont run with selinux. At least not per default.
So what is supposed to be there, why does it happen to work for me?

And if there are changes required to the config file, they should be
passed in via configure instead of doing a patch.

Olaf

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

* Re: [PATCH] tools/hotplug: update systemd dependency to use service instead of socket
  2014-12-05  7:47               ` Olaf Hering
@ 2014-12-05  8:03                 ` Olaf Hering
  2014-12-05  8:28                   ` Olaf Hering
  0 siblings, 1 reply; 16+ messages in thread
From: Olaf Hering @ 2014-12-05  8:03 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk
  Cc: Wei Liu, Ian Campbell, Stefano Stabellini, Ian Jackson,
	xen-devel, M A Young

On Fri, Dec 05, Olaf Hering wrote:

> On Thu, Dec 04, Konrad Rzeszutek Wilk wrote:
> 
> > On Thu, Dec 04, 2014 at 08:47:56AM +0100, Olaf Hering wrote:
> > > Is that something the sysadmin has to adjust, or should the xen source
> > > provide proper values?
> > It would be rather cumbersome if the sysadmin had to adjust it. The goal
> > here would be that distros could use it and package it neatly so that it
> > works out of the box.
> > 
> > What are the proper values in SuSE?
> 
> I have no idea, we dont run with selinux. At least not per default.
> So what is supposed to be there, why does it happen to work for me?
> 
> And if there are changes required to the config file, they should be
> passed in via configure instead of doing a patch.

So looking again at
tools/hotplug/Linux/systemd/var-lib-xenstored.mount.in it seems that it
happens to work for me because XENSTORED_MOUNT_CTX is set within that
file. So if something happens to need a different value for
XENSTORED_MOUNT_CTX it has to be provided in the to-be-created config
file: EnvironmentFile=-@CONFIG_DIR@/@CONFIG_LEAF_DIR@/xenstored
This config file is not part of xen. 

Does the current state of xen-4.5 (like "make rpmball") not work out of
the box on Fedora or anything that uses selinux? If thats the case it
should probably be covered in the INSTALL file.

Olaf

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

* Re: [PATCH] tools/hotplug: update systemd dependency to use service instead of socket
  2014-12-05  8:03                 ` Olaf Hering
@ 2014-12-05  8:28                   ` Olaf Hering
  2014-12-05 16:15                     ` Konrad Rzeszutek Wilk
  0 siblings, 1 reply; 16+ messages in thread
From: Olaf Hering @ 2014-12-05  8:28 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk
  Cc: Wei Liu, Ian Campbell, Stefano Stabellini, Ian Jackson,
	xen-devel, M A Young

On Fri, Dec 05, Olaf Hering wrote:

> So looking again at
> tools/hotplug/Linux/systemd/var-lib-xenstored.mount.in it seems that it
> happens to work for me because XENSTORED_MOUNT_CTX is set within that
> file. So if something happens to need a different value for
> XENSTORED_MOUNT_CTX it has to be provided in the to-be-created config
> file: EnvironmentFile=-@CONFIG_DIR@/@CONFIG_LEAF_DIR@/xenstored
> This config file is not part of xen. 

And I wonder why a new config file has to be created, instead of just
reusing the existing tools/hotplug/Linux/init.d/sysconfig.xencommons.in?

I will send out a few patches to adjust the EnvironmentFile handling.

Its just the question if a configure --with-selinux-mount-context=VAL is
needed.

Olaf

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

* Re: [PATCH] tools/hotplug: update systemd dependency to use service instead of socket
  2014-12-05  8:28                   ` Olaf Hering
@ 2014-12-05 16:15                     ` Konrad Rzeszutek Wilk
  2014-12-08  9:31                       ` Olaf Hering
  0 siblings, 1 reply; 16+ messages in thread
From: Konrad Rzeszutek Wilk @ 2014-12-05 16:15 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Wei Liu, Ian Campbell, Stefano Stabellini, Ian Jackson,
	xen-devel, M A Young, Konrad Rzeszutek Wilk

On Fri, Dec 05, 2014 at 09:28:44AM +0100, Olaf Hering wrote:
> On Fri, Dec 05, Olaf Hering wrote:
> 
> > So looking again at
> > tools/hotplug/Linux/systemd/var-lib-xenstored.mount.in it seems that it
> > happens to work for me because XENSTORED_MOUNT_CTX is set within that
> > file. So if something happens to need a different value for
> > XENSTORED_MOUNT_CTX it has to be provided in the to-be-created config
> > file: EnvironmentFile=-@CONFIG_DIR@/@CONFIG_LEAF_DIR@/xenstored
> > This config file is not part of xen. 
> 
> And I wonder why a new config file has to be created, instead of just
> reusing the existing tools/hotplug/Linux/init.d/sysconfig.xencommons.in?

Right.
> 
> I will send out a few patches to adjust the EnvironmentFile handling.

Excellent. Will be happy to test them out.
> 
> Its just the question if a configure --with-selinux-mount-context=VAL is
> needed.

OK. That might be complicated in that the context could change between
bootup and run-time (I think that is what Michael told me).


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

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

* Re: [PATCH] tools/hotplug: update systemd dependency to use service instead of socket
  2014-12-05 16:15                     ` Konrad Rzeszutek Wilk
@ 2014-12-08  9:31                       ` Olaf Hering
  0 siblings, 0 replies; 16+ messages in thread
From: Olaf Hering @ 2014-12-08  9:31 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk
  Cc: Wei Liu, Ian Campbell, Stefano Stabellini, Ian Jackson,
	xen-devel, M A Young, Konrad Rzeszutek Wilk

On Fri, Dec 05, Konrad Rzeszutek Wilk wrote:

> OK. That might be complicated in that the context could change between
> bootup and run-time (I think that is what Michael told me).

The proper place to handle mount options is /etc/fstab. My version of
systemd is kind enough to use the values frm fstab for a given mount
point.

Olaf

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

end of thread, other threads:[~2014-12-08  9:31 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-02 15:39 [PATCH] tools/hotplug: update systemd dependency to use service instead of socket Olaf Hering
2014-12-02 15:44 ` Ian Campbell
2014-12-02 18:42   ` Konrad Rzeszutek Wilk
2014-12-02 18:51     ` M A Young
2014-12-02 20:42       ` Konrad Rzeszutek Wilk
2014-12-04 13:25         ` Ian Campbell
2014-12-03 16:54       ` Konrad Rzeszutek Wilk
2014-12-03 21:11         ` M A Young
2014-12-04  7:47           ` Olaf Hering
2014-12-05  2:15             ` Konrad Rzeszutek Wilk
2014-12-05  7:47               ` Olaf Hering
2014-12-05  8:03                 ` Olaf Hering
2014-12-05  8:28                   ` Olaf Hering
2014-12-05 16:15                     ` Konrad Rzeszutek Wilk
2014-12-08  9:31                       ` Olaf Hering
2014-12-03  9:52 ` Olaf Hering

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.