/src/virt-aa-helper
/src/virtlockd
/src/virtlogd
+/src/virt-guest-shutdown.target
/tests/*.log
/tests/*.pid
/tests/*.trs
DISTCLEANFILES =
EXTRA_DIST = \
libvirtd.conf \
- libvirtd.init.in \
- libvirtd.upstart \
libvirtd.policy.in \
libvirt.rules \
libvirtd.sasl \
- libvirtd.service.in \
- virt-guest-shutdown.target \
- libvirtd.sysconf \
libvirtd.sysctl \
libvirtd.aug \
libvirtd.logrotate.in \
mv $@-t $@
BUILT_SOURCES += libvirtd.policy
-install-data-local: install-init-redhat install-init-systemd \
- install-init-upstart \
- install-data-sasl install-data-polkit \
+install-data-local: install-data-sasl install-data-polkit \
install-logrotate install-sysctl
$(MKDIR_P) $(DESTDIR)$(localstatedir)/log/libvirt \
$(DESTDIR)$(localstatedir)/run/libvirt \
$(DESTDIR)$(localstatedir)/lib/libvirt
-uninstall-local:: uninstall-init-redhat uninstall-init-systemd \
- uninstall-init-upstart \
- uninstall-data-sasl uninstall-data-polkit \
+uninstall-local:: uninstall-data-sasl uninstall-data-polkit \
uninstall-logrotate uninstall-sysctl
rmdir $(DESTDIR)$(localstatedir)/log/libvirt || :
rmdir $(DESTDIR)$(localstatedir)/run/libvirt || :
rmdir $(DESTDIR)$(localstatedir)/log/libvirt/uml || :
rmdir $(DESTDIR)$(sysconfdir)/logrotate.d || :
-install-sysconfig:
- $(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysconfig
- $(INSTALL_DATA) $(srcdir)/libvirtd.sysconf \
- $(DESTDIR)$(sysconfdir)/sysconfig/libvirtd
-uninstall-sysconfig:
- rm -f $(DESTDIR)$(sysconfdir)/sysconfig/libvirtd
- rmdir $(DESTDIR)$(sysconfdir)/sysconfig || :
-
if WITH_SYSCTL
# Use $(prefix)/lib rather than $(libdir), since man sysctl.d insists on
# /usr/lib/sysctl.d/ even when libdir is /usr/lib64
uninstall-sysctl:
endif ! WITH_SYSCTL
-if LIBVIRT_INIT_SCRIPT_RED_HAT
-
-BUILT_SOURCES += libvirtd.init
-
-install-init-redhat: install-sysconfig libvirtd.init
- $(MKDIR_P) $(DESTDIR)$(sysconfdir)/rc.d/init.d
- $(INSTALL_SCRIPT) libvirtd.init \
- $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirtd
-
-uninstall-init-redhat: uninstall-sysconfig
- rm -f $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirtd
- rmdir $(DESTDIR)$(sysconfdir)/rc.d/init.d || :
-else ! LIBVIRT_INIT_SCRIPT_RED_HAT
-install-init-redhat:
-uninstall-init-redhat:
-endif ! LIBVIRT_INIT_SCRIPT_RED_HAT
-
-
-if LIBVIRT_INIT_SCRIPT_UPSTART
-
-install-init-upstart: install-sysconfig
- $(MKDIR_P) $(DESTDIR)$(sysconfdir)/event.d
- $(INSTALL_SCRIPT) libvirtd.upstart \
- $(DESTDIR)$(sysconfdir)/event.d/libvirtd
-
-uninstall-init-upstart: uninstall-sysconfig
- rm -f $(DESTDIR)$(sysconfdir)/event.d/libvirtd
- rmdir $(DESTDIR)$(sysconfdir)/event.d || :
-else ! LIBVIRT_INIT_SCRIPT_UPSTART
-install-init-upstart:
-uninstall-init-upstart:
-endif ! LIBVIRT_INIT_SCRIPT_UPSTART
-
-
-if LIBVIRT_INIT_SCRIPT_SYSTEMD
-
-SYSTEMD_UNIT_DIR = $(prefix)/lib/systemd/system
-BUILT_SOURCES += libvirtd.service
-
-install-init-systemd: install-sysconfig libvirtd.service
- $(MKDIR_P) $(DESTDIR)$(SYSTEMD_UNIT_DIR)
- $(INSTALL_DATA) libvirtd.service \
- $(DESTDIR)$(SYSTEMD_UNIT_DIR)/libvirtd.service
- $(INSTALL_DATA) $(srcdir)/virt-guest-shutdown.target \
- $(DESTDIR)$(SYSTEMD_UNIT_DIR)/virt-guest-shutdown.target
-
-uninstall-init-systemd: uninstall-sysconfig
- rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/virt-guest-shutdown.target
- rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/libvirtd.service
- rmdir $(DESTDIR)$(SYSTEMD_UNIT_DIR) || :
-else ! LIBVIRT_INIT_SCRIPT_SYSTEMD
-install-init-systemd:
-uninstall-init-systemd:
-endif ! LIBVIRT_INIT_SCRIPT_SYSTEMD
-
-libvirtd.init: libvirtd.init.in $(top_builddir)/config.status
- $(AM_V_GEN)sed \
- -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
- -e 's|[@]sbindir[@]|$(sbindir)|g' \
- -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
- < $< > $@-t && \
- chmod a+x $@-t && \
- mv $@-t $@
-
-libvirtd.service: libvirtd.service.in $(top_builddir)/config.status
- $(AM_V_GEN)sed \
- -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
- -e 's|[@]sbindir[@]|$(sbindir)|g' \
- -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
- < $< > $@-t && \
- mv $@-t $@
-
-
check-local: check-augeas
AUG_GENTEST = $(PERL) $(top_srcdir)/build-aux/augeas-gentest.pl
+++ /dev/null
-#!/bin/sh
-
-# the following is the LSB init header see
-# http://refspecs.linuxfoundation.org/LSB_5.0.0/LSB-Core-generic/LSB-Core-generic/initscrcomconv.html
-#
-### BEGIN INIT INFO
-# Provides: libvirtd
-# Default-Start: 3 4 5
-# Default-Stop: 0 1 2 6
-# Required-Start: $network messagebus virtlogd
-# Required-Stop: $network messagebus
-# Should-Start: $named xend avahi-daemon virtlockd
-# Should-Stop: $named
-# Short-Description: daemon for libvirt virtualization API
-# Description: This is a daemon for managing guest instances
-# and libvirt virtual networks
-# See https://libvirt.org
-### END INIT INFO
-
-# the following is chkconfig init header
-#
-# libvirtd: guest and virtual network management daemon
-#
-# chkconfig: 345 97 03
-# description: This is a daemon for managing guest instances \
-# and libvirt virtual networks \
-# See https://libvirt.org
-#
-# processname: libvirtd
-# pidfile: @localstatedir@/run/libvirtd.pid
-#
-
-# Source function library.
-. @sysconfdir@/rc.d/init.d/functions
-
-SERVICE=libvirtd
-PROCESS=libvirtd
-PIDFILE=@localstatedir@/run/$SERVICE.pid
-
-LIBVIRTD_CONFIG=
-LIBVIRTD_ARGS=
-KRB5_KTNAME=/etc/libvirt/krb5.tab
-
-test -f @sysconfdir@/sysconfig/libvirtd && . @sysconfdir@/sysconfig/libvirtd
-
-export QEMU_AUDIO_DRV
-export SDL_AUDIODRIVER
-
-LIBVIRTD_CONFIG_ARGS=
-if [ -n "$LIBVIRTD_CONFIG" ]
-then
- LIBVIRTD_CONFIG_ARGS="--config $LIBVIRTD_CONFIG"
-fi
-
-RETVAL=0
-
-start() {
- echo -n $"Starting $SERVICE daemon: "
- mkdir -p @localstatedir@/cache/libvirt
- rm -rf @localstatedir@/cache/libvirt/*
-
- # LIBVIRTD_NOFILES_LIMIT from /etc/sysconfig/libvirtd is not handled
- # automatically
- if [ -n "$LIBVIRTD_NOFILES_LIMIT" ]; then
- ulimit -n "$LIBVIRTD_NOFILES_LIMIT"
- fi
-
- KRB5_KTNAME=$KRB5_KTNAME daemon --pidfile $PIDFILE --check $SERVICE $PROCESS --daemon $LIBVIRTD_CONFIG_ARGS $LIBVIRTD_ARGS
- RETVAL=$?
- echo
- [ $RETVAL -eq 0 ] && touch @localstatedir@/lock/subsys/$SERVICE
-}
-
-stop() {
- echo -n $"Stopping $SERVICE daemon: "
-
- killproc -p $PIDFILE $PROCESS
- RETVAL=$?
- echo
- if [ $RETVAL -eq 0 ]; then
- rm -f @localstatedir@/lock/subsys/$SERVICE
- rm -rf @localstatedir@/cache/libvirt/*
- else
- exit $RETVAL
- fi
-}
-
-restart() {
- stop
- start
-}
-
-reload() {
- echo -n $"Reloading $SERVICE configuration: "
-
- killproc -p $PIDFILE $PROCESS -HUP
- RETVAL=$?
- echo
- return $RETVAL
-}
-
-# See how we were called.
-case "$1" in
- start|stop|restart|reload)
- $1
- ;;
- status)
- status -p $PIDFILE $PROCESS
- RETVAL=$?
- ;;
- force-reload)
- reload
- ;;
- condrestart|try-restart)
- [ -f @localstatedir@/lock/subsys/$SERVICE ] && restart || :
- ;;
- *)
- echo $"Usage: $0 {start|stop|status|restart|condrestart|reload|force-reload|try-restart}"
- exit 2
- ;;
-esac
-exit $RETVAL
+++ /dev/null
-# NB we don't use socket activation. When libvirtd starts it will
-# spawn any virtual machines registered for autostart. We want this
-# to occur on every boot, regardless of whether any client connects
-# to a socket. Thus socket activation doesn't have any benefit
-
-[Unit]
-Description=Virtualization daemon
-Requires=virtlogd.socket
-Requires=virtlockd.socket
-Wants=systemd-machined.service
-Before=libvirt-guests.service
-After=network.target
-After=dbus.service
-After=iscsid.service
-After=apparmor.service
-After=local-fs.target
-After=remote-fs.target
-After=systemd-machined.service
-Documentation=man:libvirtd(8)
-Documentation=https://libvirt.org
-
-[Service]
-Type=notify
-EnvironmentFile=-/etc/sysconfig/libvirtd
-ExecStart=@sbindir@/libvirtd $LIBVIRTD_ARGS
-ExecReload=/bin/kill -HUP $MAINPID
-KillMode=process
-Restart=on-failure
-# At least 1 FD per guest, often 2 (eg qemu monitor + qemu agent).
-# eg if we want to support 4096 guests, we'll typically need 8192 FDs
-# If changing this, also consider virtlogd.service & virtlockd.service
-# limits which are also related to number of guests
-LimitNOFILE=8192
-# The cgroups pids controller can limit the number of tasks started by
-# the daemon, which can limit the number of domains for some hypervisors.
-# A conservative default of 8 tasks per guest results in a TasksMax of
-# 32k to support 4096 guests.
-TasksMax=32768
-
-[Install]
-WantedBy=multi-user.target
-Also=virtlockd.socket
-Also=virtlogd.socket
+++ /dev/null
-# Override the default config file
-# NOTE: This setting is no longer honoured if using
-# systemd. Set '--config /etc/libvirt/libvirtd.conf'
-# in LIBVIRTD_ARGS instead.
-#LIBVIRTD_CONFIG=/etc/libvirt/libvirtd.conf
-
-# Listen for TCP/IP connections
-# NB. must setup TLS/SSL keys prior to using this
-#LIBVIRTD_ARGS="--listen"
-
-# Override Kerberos service keytab for SASL/GSSAPI
-#KRB5_KTNAME=/etc/libvirt/krb5.tab
-
-# Override the QEMU/SDL default audio driver probing when
-# starting virtual machines using SDL graphics
-#
-# NB these have no effect for VMs using VNC, unless vnc_allow_host_audio
-# is enabled in /etc/libvirt/qemu.conf
-#QEMU_AUDIO_DRV=sdl
-#
-#SDL_AUDIODRIVER=pulse
-
-# Override the maximum number of opened files.
-# This only works with traditional init scripts.
-# In the systemd world, the limit can only be changed by overriding
-# LimitNOFILE for libvirtd.service. To do that, just create a *.conf
-# file in /etc/systemd/system/libvirtd.service.d/ (for example
-# /etc/systemd/system/libvirtd.service.d/openfiles.conf) and write
-# the following two lines in it:
-# [Service]
-# LimitNOFILE=2048
-#
-#LIBVIRTD_NOFILES_LIMIT=2048
+++ /dev/null
-# 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
-
- # LIBVIRTD_NOFILES_LIMIT from /etc/sysconfig/libvirtd is not handled
- # automatically
- if [ -n "$LIBVIRTD_NOFILES_LIMIT" ]; then
- ulimit -n "$LIBVIRTD_NOFILES_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
+++ /dev/null
-[Unit]
-Description=Libvirt guests shutdown
-Documentation=https://libvirt.org
SYSCONF_FILES = \
locking/virtlockd.sysconf \
logging/virtlogd.sysconf \
+ remote/libvirtd.sysconf \
$(NULL)
EXTRA_DIST += \
SYSVINIT_FILES_IN = \
locking/virtlockd.init.in \
logging/virtlogd.init.in \
+ remote/libvirtd.init.in \
$(NULL)
SYSVINIT_FILES = $(notdir $(SYSVINIT_FILES_IN:%.in=%))
uninstall-init::
endif ! WITH_LIBVIRTD
+libvirtd.init: remote/libvirtd.init.in $(top_builddir)/config.status
+ $(AM_V_GEN)sed \
+ -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
+ -e 's|[@]sbindir[@]|$(sbindir)|g' \
+ -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
+ < $< > $@-t && \
+ chmod a+x $@-t && \
+ mv $@-t $@
+
virtlockd.init: locking/virtlockd.init.in $(top_builddir)/config.status
$(AM_V_GEN)sed \
-e 's|[@]localstatedir[@]|$(localstatedir)|g' \
logging/virtlogd.service.in \
logging/virtlogd.socket.in \
logging/virtlogd-admin.socket.in \
+ remote/libvirtd.service.in \
+ remote/virt-guest-shutdown.target.in \
$(NULL)
EXTRA_DIST += \
uninstall-systemd:
endif ! WITH_LIBVIRTD
+libvirtd.service: remote/libvirtd.service.in $(top_builddir)/config.status
+ $(AM_V_GEN)sed \
+ -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
+ -e 's|[@]sbindir[@]|$(sbindir)|g' \
+ -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
+ < $< > $@-t && \
+ mv $@-t $@
+
+virt-guest-shutdown.target: remote/virt-guest-shutdown.target.in \
+ $(top_builddir)/config.status
+ $(AM_V_GEN)cp $< $@
+
virtlockd.service: locking/virtlockd.service.in $(top_builddir)/config.status
$(AM_V_GEN)sed \
-e 's|[@]sbindir[@]|$(sbindir)|g' \
mv $@-t $@
+UPSTART_FILES = \
+ remote/libvirtd.upstart \
+ $(NULL)
+
+EXTRA_DIST += $(UPSTART_FILES)
+
+if WITH_LIBVIRTD
+if LIBVIRT_INIT_SCRIPT_UPSTART
+
+install-upstart: install-sysconfig
+ $(MKDIR_P) $(DESTDIR)$(sysconfdir)/event.d
+ for f in $(UPSTART_FILES:%.upstart=%); \
+ do \
+ tgt=`basename $$f` ; \
+ $(INSTALL_SCRIPT) $$f.upstart $(DESTDIR)$(sysconfdir)/event.d/$$tgt ; \
+ done
+
+uninstall-upstart: uninstall-sysconfig
+ for f in $(UPSTART_FILES:%.upstart=%); \
+ do \
+ tgt=`basename $$f` ; \
+ rm -f $(DESTDIR)$(sysconfdir)/event.d/$$tgt ; \
+ done
+ rmdir $(DESTDIR)$(sysconfdir)/event.d || :
+else ! LIBVIRT_INIT_SCRIPT_UPSTART
+install-upstart:
+uninstall-upstart:
+endif ! LIBVIRT_INIT_SCRIPT_UPSTART
+else ! WITH_LIBVIRTD
+install-upstart:
+uninstall-upstart:
+endif ! WITH_LIBVIRTD
+
if WITH_SANLOCK
lockdriver_LTLIBRARIES += sanlock.la
sanlock_la_SOURCES = $(LOCK_DRIVER_SANLOCK_SOURCES)
endif WITH_NSS
-install-data-local: install-init install-systemd
+install-data-local: install-init install-systemd install-upstart
if WITH_LIBVIRTD
$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd"
$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd/files"
$(LN_S) ../default.xml default.xml )
endif WITH_NETWORK
-uninstall-local:: uninstall-init uninstall-systemd
+uninstall-local:: uninstall-init uninstall-systemd uninstall-upstart
if WITH_LIBVIRTD
rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd/files" ||:
rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd" ||:
--- /dev/null
+#!/bin/sh
+
+# the following is the LSB init header see
+# http://refspecs.linuxfoundation.org/LSB_5.0.0/LSB-Core-generic/LSB-Core-generic/initscrcomconv.html
+#
+### BEGIN INIT INFO
+# Provides: libvirtd
+# Default-Start: 3 4 5
+# Default-Stop: 0 1 2 6
+# Required-Start: $network messagebus virtlogd
+# Required-Stop: $network messagebus
+# Should-Start: $named xend avahi-daemon virtlockd
+# Should-Stop: $named
+# Short-Description: daemon for libvirt virtualization API
+# Description: This is a daemon for managing guest instances
+# and libvirt virtual networks
+# See https://libvirt.org
+### END INIT INFO
+
+# the following is chkconfig init header
+#
+# libvirtd: guest and virtual network management daemon
+#
+# chkconfig: 345 97 03
+# description: This is a daemon for managing guest instances \
+# and libvirt virtual networks \
+# See https://libvirt.org
+#
+# processname: libvirtd
+# pidfile: @localstatedir@/run/libvirtd.pid
+#
+
+# Source function library.
+. @sysconfdir@/rc.d/init.d/functions
+
+SERVICE=libvirtd
+PROCESS=libvirtd
+PIDFILE=@localstatedir@/run/$SERVICE.pid
+
+LIBVIRTD_CONFIG=
+LIBVIRTD_ARGS=
+KRB5_KTNAME=/etc/libvirt/krb5.tab
+
+test -f @sysconfdir@/sysconfig/libvirtd && . @sysconfdir@/sysconfig/libvirtd
+
+export QEMU_AUDIO_DRV
+export SDL_AUDIODRIVER
+
+LIBVIRTD_CONFIG_ARGS=
+if [ -n "$LIBVIRTD_CONFIG" ]
+then
+ LIBVIRTD_CONFIG_ARGS="--config $LIBVIRTD_CONFIG"
+fi
+
+RETVAL=0
+
+start() {
+ echo -n $"Starting $SERVICE daemon: "
+ mkdir -p @localstatedir@/cache/libvirt
+ rm -rf @localstatedir@/cache/libvirt/*
+
+ # LIBVIRTD_NOFILES_LIMIT from /etc/sysconfig/libvirtd is not handled
+ # automatically
+ if [ -n "$LIBVIRTD_NOFILES_LIMIT" ]; then
+ ulimit -n "$LIBVIRTD_NOFILES_LIMIT"
+ fi
+
+ KRB5_KTNAME=$KRB5_KTNAME daemon --pidfile $PIDFILE --check $SERVICE $PROCESS --daemon $LIBVIRTD_CONFIG_ARGS $LIBVIRTD_ARGS
+ RETVAL=$?
+ echo
+ [ $RETVAL -eq 0 ] && touch @localstatedir@/lock/subsys/$SERVICE
+}
+
+stop() {
+ echo -n $"Stopping $SERVICE daemon: "
+
+ killproc -p $PIDFILE $PROCESS
+ RETVAL=$?
+ echo
+ if [ $RETVAL -eq 0 ]; then
+ rm -f @localstatedir@/lock/subsys/$SERVICE
+ rm -rf @localstatedir@/cache/libvirt/*
+ else
+ exit $RETVAL
+ fi
+}
+
+restart() {
+ stop
+ start
+}
+
+reload() {
+ echo -n $"Reloading $SERVICE configuration: "
+
+ killproc -p $PIDFILE $PROCESS -HUP
+ RETVAL=$?
+ echo
+ return $RETVAL
+}
+
+# See how we were called.
+case "$1" in
+ start|stop|restart|reload)
+ $1
+ ;;
+ status)
+ status -p $PIDFILE $PROCESS
+ RETVAL=$?
+ ;;
+ force-reload)
+ reload
+ ;;
+ condrestart|try-restart)
+ [ -f @localstatedir@/lock/subsys/$SERVICE ] && restart || :
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|status|restart|condrestart|reload|force-reload|try-restart}"
+ exit 2
+ ;;
+esac
+exit $RETVAL
--- /dev/null
+# NB we don't use socket activation. When libvirtd starts it will
+# spawn any virtual machines registered for autostart. We want this
+# to occur on every boot, regardless of whether any client connects
+# to a socket. Thus socket activation doesn't have any benefit
+
+[Unit]
+Description=Virtualization daemon
+Requires=virtlogd.socket
+Requires=virtlockd.socket
+Wants=systemd-machined.service
+Before=libvirt-guests.service
+After=network.target
+After=dbus.service
+After=iscsid.service
+After=apparmor.service
+After=local-fs.target
+After=remote-fs.target
+After=systemd-machined.service
+Documentation=man:libvirtd(8)
+Documentation=https://libvirt.org
+
+[Service]
+Type=notify
+EnvironmentFile=-/etc/sysconfig/libvirtd
+ExecStart=@sbindir@/libvirtd $LIBVIRTD_ARGS
+ExecReload=/bin/kill -HUP $MAINPID
+KillMode=process
+Restart=on-failure
+# At least 1 FD per guest, often 2 (eg qemu monitor + qemu agent).
+# eg if we want to support 4096 guests, we'll typically need 8192 FDs
+# If changing this, also consider virtlogd.service & virtlockd.service
+# limits which are also related to number of guests
+LimitNOFILE=8192
+# The cgroups pids controller can limit the number of tasks started by
+# the daemon, which can limit the number of domains for some hypervisors.
+# A conservative default of 8 tasks per guest results in a TasksMax of
+# 32k to support 4096 guests.
+TasksMax=32768
+
+[Install]
+WantedBy=multi-user.target
+Also=virtlockd.socket
+Also=virtlogd.socket
--- /dev/null
+# Override the default config file
+# NOTE: This setting is no longer honoured if using
+# systemd. Set '--config /etc/libvirt/libvirtd.conf'
+# in LIBVIRTD_ARGS instead.
+#LIBVIRTD_CONFIG=/etc/libvirt/libvirtd.conf
+
+# Listen for TCP/IP connections
+# NB. must setup TLS/SSL keys prior to using this
+#LIBVIRTD_ARGS="--listen"
+
+# Override Kerberos service keytab for SASL/GSSAPI
+#KRB5_KTNAME=/etc/libvirt/krb5.tab
+
+# Override the QEMU/SDL default audio driver probing when
+# starting virtual machines using SDL graphics
+#
+# NB these have no effect for VMs using VNC, unless vnc_allow_host_audio
+# is enabled in /etc/libvirt/qemu.conf
+#QEMU_AUDIO_DRV=sdl
+#
+#SDL_AUDIODRIVER=pulse
+
+# Override the maximum number of opened files.
+# This only works with traditional init scripts.
+# In the systemd world, the limit can only be changed by overriding
+# LimitNOFILE for libvirtd.service. To do that, just create a *.conf
+# file in /etc/systemd/system/libvirtd.service.d/ (for example
+# /etc/systemd/system/libvirtd.service.d/openfiles.conf) and write
+# the following two lines in it:
+# [Service]
+# LimitNOFILE=2048
+#
+#LIBVIRTD_NOFILES_LIMIT=2048
--- /dev/null
+# 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
+
+ # LIBVIRTD_NOFILES_LIMIT from /etc/sysconfig/libvirtd is not handled
+ # automatically
+ if [ -n "$LIBVIRTD_NOFILES_LIMIT" ]; then
+ ulimit -n "$LIBVIRTD_NOFILES_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
--- /dev/null
+[Unit]
+Description=Libvirt guests shutdown
+Documentation=https://libvirt.org