libvirtd.init-r16 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. #!/sbin/openrc-run
  2. # Copyright 1999-2015 Gentoo Foundation
  3. # Distributed under the terms of the GNU General Public License v2
  4. description="Virtual Machine Management daemon (libvirt)"
  5. LIBVIRTD_OPTS=${LIBVIRTD_OPTS:-"${LIBVIRTD_OPTS}"}
  6. LIBVIRTD_TIMEOUT=${LIBVIRTD_TERMTIMEOUT:-"TERM/25/KILL/5"}
  7. command="/usr/sbin/libvirtd"
  8. command_args="-d ${LIBVIRTD_OPTS}"
  9. start_stop_daemon_args="--env KRB5_KTNAME=/etc/libvirt/krb5.tab"
  10. pidfile="/var/run/libvirtd.pid"
  11. retry="${LIBVIRTD_TERMTIMEOUT}"
  12. depend() {
  13. need virtlogd
  14. use dbus virtlockd
  15. after ntp-client ntpd nfs nfsmount portmap rpc.statd iptables ip6tables ebtables corosync sanlock cgconfig xenconsoled
  16. USE_FLAG_FIREWALLD
  17. USE_FLAG_AVAHI
  18. USE_FLAG_ISCSI
  19. USE_FLAG_RBD
  20. }
  21. start_pre() {
  22. # Test configuration directories in /etc/libvirt/ to be either not
  23. # present or a directory, i.e. not a regular file, bug #532892
  24. checkpath --directory /etc/libvirt/lxc || return 1
  25. checkpath --directory /etc/libvirt/nwfilter || return 1
  26. checkpath --directory /etc/libvirt/qemu || return 1
  27. checkpath --directory /etc/libvirt/storage || return 1
  28. }