[libvirt] [PATCH 0/2] require dbus on Fedora-based systems

https://bugzilla.redhat.com/show_bug.cgi?id=830201 Ultimately, I want to figure out if it is possible to configure --without-dbus, and still get libvirtd to boot. However, that is less urgent than fixing things so that on Fedora and RHEL, the dbus package is installed up front, since we have the situation where libvirtd behaves poorly if dbus is not available. Eric Blake (2): systemd: require dbus service spec: require dbus-daemon when using libvirtd in Fedora

https://bugzilla.redhat.com/show_bug.cgi?id=830201 The initscript and upstart services depend on dbus starting before libvirtd. When we first wrote the systemd script, we tried to do the same, but we depended on dbus.target (which does not exist) in comparison to network.target (which does exist), so we removed that in commit 4c7973e. But we still need dbus up and running first, especially now that we want to support shutdown inhibition via dbus (whereas we originally needed dbus only for firewall control). http://www.freedesktop.org/software/systemd/man/systemd.target.html explains how a target (such as network.target) is just a collection of common services bundled together, and why we want network.target but dbus.service. * daemon/libvirtd.service.in (Unit): Depend on dbus starting first. --- .gnulib | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/.gnulib b/.gnulib index d245e6d..440a1db 160000 --- a/.gnulib +++ b/.gnulib @@ -1 +1 @@ -Subproject commit d245e6ddd6ab2624d0d83acd8f111454f984f50f +Subproject commit 440a1dbe523e37f206252cb034c3a62f26867e42 -- 1.7.1

On 12/04/2012 08:34 PM, Eric Blake wrote:
https://bugzilla.redhat.com/show_bug.cgi?id=830201
The initscript and upstart services depend on dbus starting before libvirtd. When we first wrote the systemd script, we tried to do the same, but we depended on dbus.target (which does not exist) in comparison to network.target (which does exist), so we removed that in commit 4c7973e. But we still need dbus up and running first, especially now that we want to support shutdown inhibition via dbus (whereas we originally needed dbus only for firewall control).
http://www.freedesktop.org/software/systemd/man/systemd.target.html explains how a target (such as network.target) is just a collection of common services bundled together, and why we want network.target but dbus.service.
* daemon/libvirtd.service.in (Unit): Depend on dbus starting first. --- .gnulib | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
Self-NAK - this isn't the patch I meant to send. v2 coming up. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

https://bugzilla.redhat.com/show_bug.cgi?id=830201 In older Fedora, the spec file for libivrt depended on avahi, which included avahi-daemon, which in turn depended on dbus. But now that avahi libs and avahi-daemon are (correctly) in separate pacakges, and since we REALLY don't want a mandatory dependency on avahi-daemon, and considering that our init scripts require the messagebus service from dbus, we need to explicitly require dbus ourselves. * libvirt.spec.in (Requires): Add dbus for libvirt-daemon. --- libvirt.spec.in | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index ec6fc8b..c4c96e4 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -712,6 +712,8 @@ Requires(postun): systemd-units %if %{with_numad} Requires: numad %endif +# libvirtd depends on 'messagebus' service +Requires: dbus %description daemon Server side daemon required to manage the virtualization capabilities -- 1.7.1

https://bugzilla.redhat.com/show_bug.cgi?id=830201 The initscript and upstart services depend on dbus starting before libvirtd. When we first wrote the systemd script, we tried to do the same, but we depended on dbus.target (which does not exist) in comparison to network.target (which does exist), so we removed that in commit 4c7973e. But we still need dbus up and running first, especially now that we want to support shutdown inhibition via dbus (whereas we originally needed dbus only for firewall control). http://www.freedesktop.org/software/systemd/man/systemd.target.html explains how a target (such as network.target) is just a collection of common services bundled together, and why we want network.target but dbus.service. * daemon/libvirtd.service.in (Unit): Depend on dbus starting first. --- v2: send the correct patch daemon/libvirtd.service.in | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/daemon/libvirtd.service.in b/daemon/libvirtd.service.in index b7afadf..98dd5a0 100644 --- a/daemon/libvirtd.service.in +++ b/daemon/libvirtd.service.in @@ -7,6 +7,7 @@ Description=Virtualization daemon Before=libvirt-guests.service After=network.target +After=dbus.service [Service] EnvironmentFile=-/etc/sysconfig/libvirtd -- 1.7.1

On 12/05/2012 11:43 AM, Eric Blake wrote:
https://bugzilla.redhat.com/show_bug.cgi?id=830201
The initscript and upstart services depend on dbus starting before libvirtd. When we first wrote the systemd script, we tried to do the same, but we depended on dbus.target (which does not exist) in comparison to network.target (which does exist), so we removed that in commit 4c7973e. But we still need dbus up and running first, especially now that we want to support shutdown inhibition via dbus (whereas we originally needed dbus only for firewall control).
http://www.freedesktop.org/software/systemd/man/systemd.target.html explains how a target (such as network.target) is just a collection of common services bundled together, and why we want network.target but dbus.service.
* daemon/libvirtd.service.in (Unit): Depend on dbus starting first. ---
v2: send the correct patch
daemon/libvirtd.service.in | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/daemon/libvirtd.service.in b/daemon/libvirtd.service.in index b7afadf..98dd5a0 100644 --- a/daemon/libvirtd.service.in +++ b/daemon/libvirtd.service.in @@ -7,6 +7,7 @@ Description=Virtualization daemon Before=libvirt-guests.service After=network.target +After=dbus.service
[Service] EnvironmentFile=-/etc/sysconfig/libvirtd
According to the following link http://www.freedesktop.org/software/systemd/man/systemd.unit.html "It is a common pattern to include a unit name in both the |After=| and |Requires=| option in which case the unit listed will be started before the unit that is configured with these options. " But it is okay to be written without "Requires" option. ACK. Guannan

https://bugzilla.redhat.com/show_bug.cgi?id=830201 In older Fedora, the spec file for libivrt depended on avahi, which included avahi-daemon, which in turn depended on dbus. But now that avahi libs and avahi-daemon are (correctly) in separate pacakges, and since we REALLY don't want a mandatory dependency on avahi-daemon, and considering that our init scripts require the messagebus service from dbus, we need to explicitly require dbus ourselves. * libvirt.spec.in (Requires): Add dbus for libvirt-daemon. --- v2: no change libvirt.spec.in | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index ec6fc8b..c4c96e4 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -712,6 +712,8 @@ Requires(postun): systemd-units %if %{with_numad} Requires: numad %endif +# libvirtd depends on 'messagebus' service +Requires: dbus %description daemon Server side daemon required to manage the virtualization capabilities -- 1.7.1

On 12/05/2012 11:43 AM, Eric Blake wrote:
https://bugzilla.redhat.com/show_bug.cgi?id=830201
In older Fedora, the spec file for libivrt depended on avahi, which included avahi-daemon, which in turn depended on dbus. But now that avahi libs and avahi-daemon are (correctly) in separate pacakges, and since we REALLY don't want a mandatory dependency on avahi-daemon, and considering that our init scripts require the messagebus service from dbus, we need to explicitly require dbus ourselves.
* libvirt.spec.in (Requires): Add dbus for libvirt-daemon. ---
v2: no change
libvirt.spec.in | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/libvirt.spec.in b/libvirt.spec.in index ec6fc8b..c4c96e4 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -712,6 +712,8 @@ Requires(postun): systemd-units %if %{with_numad} Requires: numad %endif +# libvirtd depends on 'messagebus' service +Requires: dbus
%description daemon Server side daemon required to manage the virtualization capabilities
ACK. Guannan

On 12/05/2012 11:43 AM, Eric Blake wrote:
https://bugzilla.redhat.com/show_bug.cgi?id=830201
In older Fedora, the spec file for libivrt depended on avahi, which included avahi-daemon, which in turn depended on dbus. But now that avahi libs and avahi-daemon are (correctly) in separate pacakges, and since we REALLY don't want a mandatory dependency on avahi-daemon, and considering that our init scripts require the messagebus service from dbus, we need to explicitly require dbus ourselves.
* libvirt.spec.in (Requires): Add dbus for libvirt-daemon. ---
v2: no change
libvirt.spec.in | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/libvirt.spec.in b/libvirt.spec.in index ec6fc8b..c4c96e4 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -712,6 +712,8 @@ Requires(postun): systemd-units %if %{with_numad} Requires: numad %endif +# libvirtd depends on 'messagebus' service +Requires: dbus
%description daemon Server side daemon required to manage the virtualization capabilities
These two patches is pushed.
participants (2)
-
Eric Blake
-
Guannan Ren