[Ovirt-devel] [PATCH-node 2/2] A rather large re-write of the ovirt-node.spec file. The reason
Daniel P. Berrange
berrange at redhat.com
Wed Sep 10 20:24:30 UTC 2008
On Wed, Sep 10, 2008 at 01:11:57PM -0700, David Lutterkort wrote:
> On Wed, 2008-09-10 at 08:42 +0200, Chris Lalancette wrote:
> > +
> > +ovirt_setup_libvirtd() {
> > + # just to get a boot warning to shut up
> > + touch /etc/resolv.conf
> > +
> > + # make libvirtd listen on the external interfaces
> > + sed -i -e 's/^#\(LIBVIRTD_ARGS="--listen"\).*/\1/' \
> > + /etc/sysconfig/libvirtd
> > +
> > + # set up qemu daemon to allow outside VNC connections
> > + sed -i -e 's/^[[:space:]]*#[[:space:]]*\(vnc_listen = "0.0.0.0"\).*/\1/' \
> > + /etc/libvirt/qemu.conf
> > + # set up libvirtd to listen on TCP (for kerberos)
> > + sed -i -e "s/^[[:space:]]*#[[:space:]]*\(listen_tcp\)\>.*/\1 = 1/" \
> > + -e "s/^[[:space:]]*#[[:space:]]*\(listen_tls\)\>.*/\1 = 0/" \
> > + /etc/libvirt/libvirtd.conf
> > +
> > + # with libvirt (0.4.0), make sure we we setup gssapi in the mech_list
> > + sasl_conf=/etc/sasl2/libvirt.conf
> > + if ! grep -qE "^mech_list: gssapi" $sasl_conf ; then
> > + sed -i -e "s/^\([[:space:]]*mech_list.*\)/#\1/" $sasl_conf
> > + echo "mech_list: gssapi" >> $sasl_conf
> > + fi
> > +}
>
> Why not just
>
> augtool <<EOF
> set /files/etc/sysconfig/libvirtd/LIBVIRTD_ARGS --listen
> set /files/etc/libvirt/qemu.conf/vnc_listen 0.0.0.0
> set /files/etc/libvirt/libvirtd.conf/listen_tcp 1
> set /files/etc/libvirt/libvirtd.conf/listen_tls 0
> set /files/etc/sasl2/libvirt.conf/mech_list gssapi
> save
> EOF
>
> It'll actually need some minor love in Augeas to make that work, but if
> you want to go that route, I can add that very easily.
Yes, if you update to libvirt 0.4.5 the augeas definitions are all
there as standard for both qemu.conf and libvirtd.conf. I think augeas
has generic handling for sysconfig files ? If not it'd be trivial to
add the libvirtd sysconfig file too. Not sure about sasl configs ?
Daniel
--
|: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
More information about the ovirt-devel
mailing list