libvirtd.initd 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. #!/usr/bin/openrc-run
  2. # Copyright 1999-2020 Gentoo Authors
  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/bin/libvirtd"
  8. command_args="${LIBVIRTD_OPTS}"
  9. start_stop_daemon_args="-b --env KRB5_KTNAME=/etc/libvirt/krb5.tab"
  10. pidfile="/run/libvirtd.pid"
  11. retry="${LIBVIRTD_TERMTIMEOUT}"
  12. depend() {
  13. need virtlogd
  14. use ceph dbus iscsid virtlockd firewalld avahi-daemon
  15. after cgconfig corosync ebtables iptables ip6tables nfs nfsmount ntp-client ntpdportmap rpc.statd sanlock xenconsoled
  16. }
  17. start_pre() {
  18. # Test configuration directories in /etc/libvirt/ to be either not
  19. # present or a directory, i.e. not a regular file, bug #532892
  20. checkpath --directory /etc/libvirt/lxc || return 1
  21. checkpath --directory /etc/libvirt/nwfilter || return 1
  22. [ -L /etc/libvirt/qemu ] ||
  23. checkpath --directory /etc/libvirt/qemu || return 1
  24. [ -L /etc/libvirt/storage ] ||
  25. checkpath --directory /etc/libvirt/storage || return 1
  26. }