libvirt/daemon/libvirtd.upstart
Peter Krempa 831977df56 daemon: Don't remove pidfiles in init scripts
Init scripts removed pid file of the daemon. Removing pid files may be
harmful as new api for crash-safe pidfiles is used (introduced by
c8a3a26).
2011-09-27 10:53:46 +02:00

43 lines
991 B
Plaintext

# libvirtd upstart job
#
# XXX wait for rc to get all dependent initscripts started
# from sysv libvirtd initscript: Required-Start: $network messagebus
start on stopped rc RUNLEVEL=[345]
stop on runlevel [!345]
respawn
script
LIBVIRTD_CONFIG=
LIBVIRTD_ARGS=
KRB5_KTNAME=/etc/libvirt/krb5.tab
if [ -f /etc/sysconfig/libvirtd ]; then
. /etc/sysconfig/libvirtd
fi
export QEMU_AUDIO_DRV
export SDL_AUDIODRIVER
export KRB5_KTNAME
LIBVIRTD_CONFIG_ARGS=
if [ -n "$LIBVIRTD_CONFIG" ]; then
LIBVIRTD_CONFIG_ARGS="--config $LIBVIRTD_CONFIG"
fi
# DAEMON_COREFILE_LIMIT from /etc/sysconfig/libvirtd is not handled
# automatically
if [ -n "$DAEMON_COREFILE_LIMIT" ]; then
ulimit -c "$DAEMON_COREFILE_LIMIT"
fi
mkdir -p /var/cache/libvirt
rm -rf /var/cache/libvirt/*
exec /usr/sbin/libvirtd $LIBVIRTD_CONFIG_ARGS $LIBVIRTD_ARGS
end script
post-stop script
rm -rf /var/cache/libvirt/*
end script