2016-04-12 06:36:20 +08:00
|
|
|
# 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
|
|
|
|
|
2011-07-07 21:45:07 +08:00
|
|
|
[Unit]
|
|
|
|
Description=Virtualization daemon
|
2016-09-06 21:16:24 +08:00
|
|
|
Requires=virtlogd.socket
|
2017-01-17 23:45:57 +08:00
|
|
|
Requires=virtlockd.socket
|
2011-07-07 21:45:07 +08:00
|
|
|
Before=libvirt-guests.service
|
2012-07-09 23:52:55 +08:00
|
|
|
After=network.target
|
2012-12-05 11:43:04 +08:00
|
|
|
After=dbus.service
|
2013-03-01 04:46:19 +08:00
|
|
|
After=iscsid.service
|
2014-03-03 18:26:43 +08:00
|
|
|
After=apparmor.service
|
2015-08-25 23:07:46 +08:00
|
|
|
After=local-fs.target
|
|
|
|
After=remote-fs.target
|
2014-01-09 02:55:19 +08:00
|
|
|
Documentation=man:libvirtd(8)
|
|
|
|
Documentation=http://libvirt.org
|
2011-07-07 21:45:07 +08:00
|
|
|
|
|
|
|
[Service]
|
2014-02-21 20:06:42 +08:00
|
|
|
Type=notify
|
2011-07-07 21:45:07 +08:00
|
|
|
EnvironmentFile=-/etc/sysconfig/libvirtd
|
|
|
|
ExecStart=@sbindir@/libvirtd $LIBVIRTD_ARGS
|
|
|
|
ExecReload=/bin/kill -HUP $MAINPID
|
2012-03-22 22:01:12 +08:00
|
|
|
KillMode=process
|
2013-07-30 20:32:59 +08:00
|
|
|
Restart=on-failure
|
2017-03-16 00:51:51 +08:00
|
|
|
# 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
|
2017-04-20 02:54:33 +08:00
|
|
|
# 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
|
2011-07-07 21:45:07 +08:00
|
|
|
|
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|
2015-12-07 20:46:27 +08:00
|
|
|
Also=virtlockd.socket
|
|
|
|
Also=virtlogd.socket
|