Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > 45d39df1ad22a949d593167c0dee7c41 > scriptlet

libvirt-0.8.8-4.fc15.i686.rpm

PREIN

/bin/sh
# Normally 'setup' adds this in /etc/passwd, but this is
# here for case of upgrades from earlier Fedora/RHEL. This
# UID/GID pair is reserved for qemu:qemu
getent group kvm >/dev/null || groupadd -g 36 -r kvm
getent group qemu >/dev/null || groupadd -g 107 -r qemu
getent passwd qemu >/dev/null || \
  useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin \
    -c "qemu user" qemu

PREUN

/bin/sh
if [ $1 = 0 ]; then
    /sbin/service libvirtd stop 1>/dev/null 2>&1
    /sbin/chkconfig --del libvirtd
fi

POSTIN

/bin/sh

# We want to install the default network for initial RPM installs
# or on the first upgrade from a non-network aware libvirt only.
# We check this by looking to see if the daemon is already installed
/sbin/chkconfig --list libvirtd 1>/dev/null 2>&1
if test $? != 0 && test ! -f /etc/libvirt/qemu/networks/default.xml
then
    UUID=`/usr/bin/uuidgen`
    sed -e "s,</name>,</name>\n  <uuid>$UUID</uuid>," \
         < /usr/share/libvirt/networks/default.xml \
         > /etc/libvirt/qemu/networks/default.xml
    ln -s ../default.xml /etc/libvirt/qemu/networks/autostart/default.xml
fi

if [ "$1" -eq "1" ]; then
/sbin/chkconfig cgconfig on
fi

/sbin/chkconfig --add libvirtd
if [ "$1" -ge "1" ]; then
	/sbin/service libvirtd condrestart > /dev/null 2>&1
fi