[libvirt] [PATCH] Add support for systemd init service

Eric Blake eblake at redhat.com
Wed Nov 16 23:03:45 UTC 2011


On 11/16/2011 05:01 AM, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" <berrange at redhat.com>
> 
> 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 v4:
> 
>   - Print chosen init script type in configure.ac summary
>   - Support upstart install
>   - Error from configure on unsupported requests
>   - Remove bogus dep from policykit install to redhat init
> 

> -AM_CONDITIONAL([LIBVIRT_INIT_SCRIPT_RED_HAT], test x$with_init_script = xredhat)
> +            [AC_HELP_STRING([--with-init-script@<:@=STYLE@:>@],
> +                            [Style of init script to install: redhat, systemd, systemd+redhat,
> +                             upstart, auto, none @<:@default=auto@:>@])])
> +init_redhat=no
> +init_systemd=no
> +case "$with_init_script" in
> +    systemd+redhat)
> +       init_redhat=yes
> +       init_systemd=yes
> +       ;;
> +    systemd)
> +       init_systemd=yes
> +       ;;
> +    redhat)
> +       init_redhat=yes
> +       ;;
> +    none)
> +       ;;
> +    *)
> +       if test "$cross_compiling" != yes && test -f /etc/redhat-release; then
> +          init_redhat=yes
> +          with_init_script=redhat

Umm, this still has the same problem as v3; with_init_script of upstart
is converted to redhat.  Did you forget to commit your changes?

> +       fi
> +       ;;
> +esac
> +AM_CONDITIONAL([LIBVIRT_INIT_SCRIPT_RED_HAT], test "$init_redhat" = "yes")
> +AM_CONDITIONAL([LIBVIRT_INIT_SCRIPT_SYSTEMD], test "$init_systemd" = "yes")
>  AC_MSG_RESULT($with_init_script)
>  

Also, there's a missing AM_CONDITIONAL([LIBVIRT_INIT_SCRIPT_UPSTART],...)

> +
> +if LIBVIRT_INIT_SCRIPT_UPSTART

although this expects it to exist.

Everything else looks good, so I'm assuming that the problems in
configure.ac were due to forgetting 'git add' before 'git commit --amend'.

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 620 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20111116/59183a2b/attachment-0001.sig>


More information about the libvir-list mailing list