Re: [libvirt] [PATCH v5] Add support for systemd init service

2011-11-18 Thread Daniel P. Berrange
On Wed, Nov 16, 2011 at 07:23:51PM -0500, Laine Stump wrote:
> On 11/16/2011 09:20 AM, Daniel P. Berrange wrote:
> >From: "Daniel P. Berrange"
> >
> >This patch adds support for a systemd init service for libvirtd
> >and libvirt-guests. The libvirtd.service is *not* written to use
> >socket activation, since we want libvirtd to start on boot so it
> >can do guest auto-start.
> 
> Dang! I guess I have to do this for the transaction rollback
> initscript in netcf. Any advice / pointers to docs other than "read
> my patch and do what I did"?? :-)

Read my patch and do what I did ;-P

More seriously though, the netcf transaction script needs are pretty
similar to the libvirt-guests script.

If I'm honest, the way I handled the libvirt-guest script here is
kind of lame, and the minimum possible work.

I basically left the libvirt-guests script in /etc/init.d and just
wrote a systemd service to directly invoke it.

Really the way the libvirt-guests script is written in the first
place was wrong. We should never have had all the functionality
in the initscript in the first place. The save/restore-all-guests
code should have been in a proper support command in /usr/bin (or
/usr/sbin), with a name like  virt-guest-lifecycle or something
less stupid. THe initscript should then have merely invoked that
command with a shutdown/startup arg.

So for netcf, I would suggest the same idea. Create a new command
/usr/sbin/netcf-transaction to contain all the actual business
logic. Then just make your initscript invoke that. Now you can
trivially also create a systemd service to invoke that.

Daniel
-- 
|: http://berrange.com  -o-http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org  -o- http://virt-manager.org :|
|: http://autobuild.org   -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org   -o-   http://live.gnome.org/gtk-vnc :|

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH v5] Add support for systemd init service

2011-11-16 Thread Laine Stump

On 11/16/2011 09:20 AM, Daniel P. Berrange wrote:

From: "Daniel P. Berrange"

This patch adds support for a systemd init service for libvirtd
and libvirt-guests. The libvirtd.service is *not* written to use
socket activation, since we want libvirtd to start on boot so it
can do guest auto-start.


Dang! I guess I have to do this for the transaction rollback initscript 
in netcf. Any advice / pointers to docs other than "read my patch and do 
what I did"?? :-)


--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH v5] Add support for systemd init service

2011-11-16 Thread Eric Blake
On 11/16/2011 07:20 AM, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" 
> 
> This patch adds support for a systemd init service for libvirtd
> and libvirt-guests. The libvirtd.service is *not* written to use
> socket activation, since we want libvirtd to start on boot so it
> can do guest auto-start.
> 
> The libvirt-guests.service is pretty lame, just exec'ing the
> original init script for now. Ideally we would factor out the
> functionality, into some shared tool.
> 
> Instead of
> 
>   ./configure --with-init-script=redhat
> 
> You can now do
> 
>   ./configure --with-init-script=systemd
> 
> Or better still:
> 
>   ./configure --with-init-script=systemd+redhat
> 
> We can also now support install of the upstart init script
> 
> In v5:
> 
>  - Actually include the changes to configure.ac I mentioned
>in v4.

Oops - serves me right for reading my inbox in order :)

ACK.  (Phew!)

-- 
Eric Blake   ebl...@redhat.com+1-919-301-3266
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list