[libvirt] RFC: Post-install behavior of libvirt(-client)
mkletzan at redhat.com
Wed Feb 15 12:58:21 UTC 2012
On 02/15/2012 11:57 AM, Daniel P. Berrange wrote:
> On Tue, Feb 14, 2012 at 03:17:40PM -0700, Eric Blake wrote:
>> On 02/14/2012 01:37 AM, Martin Kletzander wrote:
>>> Hello everyone,
>>> I have a small bug #786770  assigned and I discussed this with few
>>> people from our team but I'm still not sure what should be the proper
>>> fix for this bug.
>>> Thinking about this a little more, I see two more "unconsistencies"
>>> let's say:
>>> - we are starting libvirt-guests if it is enabled (rpm post script
>>> should not start services)
>> Ultimately, I see two possible useful behaviors:
>> 1. We install but don't start services. Since both libvirtd and
>> libvirt-guests have a Default-Start: 3 4 5 (for init script) or
>> [Install]WantedBy=multi-user.target (for systemd), then the user will
>> get both services running after their next reboot (by virtue of their
>> defaults), but not beforehand.
>> If the user wants to start the services before rebooting, then they
>> should start both services - if the user starts libvirtd but not
>> libvirt-guests, it is their own fault for not realizing that
>> libvirt-guests was useful.
>> 2. We install services, and if it is the initial install, we also
>> default those services to start immediately. And, since libvirt-client
>> can be installed without libvirtd, we make sure that the libvirt-guests
>> init script has sane default behavior when it cannot connect to a
>> running libvirtd.
>> Where is it written that rpms may not start services? Finding a
>> concrete policy on the matter should influence our answer...
> It is a basic Fedora requirement that you may *not* start any
> services during %post scripts. The reason for this is that the
> RPMs need to be installable in virutal chroot directories for
> the purposes of building RPMs.
> The only permissable things are
> - Mark the service to be started by default
> - Issue a conditional restart - ie, if we detect the service
> already running, it is permissable to restart it.
I'm inclining to the former as well. It seems more clear and
straightforward for me. I also spoke with Dave about this and he had one
more idea about this. In order to change the behavior as less as
possible, we could leave it this way and just check if /sbin/runlevel
returns the runlevel as it should or not and in case of an error, just
skip the starting, otherwise leave it as it is.
More information about the libvir-list