--- /dev/null
+#!/sbin/openrc-run
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+description="Virtual Machine Management daemon (libvirt)"
+
+LIBVIRTD_OPTS=${LIBVIRTD_OPTS:-"${LIBVIRTD_OPTS}"}
+LIBVIRTD_TIMEOUT=${LIBVIRTD_TERMTIMEOUT:-"TERM/25/KILL/5"}
+
+command="/usr/sbin/libvirtd"
+command_args="${LIBVIRTD_OPTS}"
+start_stop_daemon_args="-b --env KRB5_KTNAME=/etc/libvirt/krb5.tab"
+pidfile="/run/libvirtd.pid"
+retry="${LIBVIRTD_TERMTIMEOUT}"
+
+depend() {
+ need virtlogd
+ use ceph dbus iscsid virtlockd
+ after cgconfig corosync ebtables iptables ip6tables nfs nfsmount ntp-client ntpdportmap rpc.statd sanlock xenconsoled
+ USE_FLAG_FIREWALLD
+}
+
+start_pre() {
+ # Test configuration directories in /etc/libvirt/ to be either not
+ # present or a directory, i.e. not a regular file, bug #532892
+
+ checkpath --directory /etc/libvirt/lxc || return 1
+ checkpath --directory /etc/libvirt/nwfilter || return 1
+ [ -L /etc/libvirt/qemu ] ||
+ checkpath --directory /etc/libvirt/qemu || return 1
+ [ -L /etc/libvirt/storage ] ||
+ checkpath --directory /etc/libvirt/storage || return 1
+}
--- /dev/null
+#!/sbin/openrc-run
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+description="libvirt virtual machine lock manager"
+command="/usr/sbin/virtlockd"
+start_stop_daemon_args="-b"
+pidfile="/run/virtlockd.pid"
+
+extra_started_commands="reload"
+description_reload="re-exec the daemon, while maintaining locks and clients"
+
+
+depend() {
+ after ntp-client ntpd nfs nfsmount corosync
+}
+
+reload() {
+ ebegin "re-exec() virtlockd"
+
+ start-stop-daemon --signal SIGUSR1 \
+ --exec "${command}" --pidfile "${pidfile}"
+}
--- /dev/null
+#!/sbin/openrc-run
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+description="libvirt virtual machine logging manager"
+command="/usr/sbin/virtlogd"
+start_stop_daemon_args="-b"
+pidfile="/run/virtlogd.pid"
+
+extra_started_commands="reload"
+description_reload="re-exec the daemon, while maintaining open connections"
+
+
+depend() {
+ after ntp-client ntpd nfs nfsmount corosync
+}
+
+reload() {
+ ebegin "re-exec() virtlogd"
+
+ start-stop-daemon --signal SIGUSR1 \
+ --exec "${command}" --pidfile "${pidfile}"
+}
default
# Tweak the init script:
- cp "${FILESDIR}/libvirtd.init-r18" "${S}/libvirtd.init" || die
+ cp "${FILESDIR}/libvirtd.init-r19" "${S}/libvirtd.init" || die
sed -e "s/USE_FLAG_FIREWALLD/$(usex firewalld 'need firewalld' '')/" \
-i "${S}/libvirtd.init" || die "sed failed"
newinitd "${S}/libvirtd.init" libvirtd
newinitd "${FILESDIR}/libvirt-guests.init-r4" libvirt-guests
- newinitd "${FILESDIR}/virtlockd.init-r1" virtlockd
- newinitd "${FILESDIR}/virtlogd.init-r1" virtlogd
+ newinitd "${FILESDIR}/virtlockd.init-r2" virtlockd
+ newinitd "${FILESDIR}/virtlogd.init-r2" virtlogd
newconfd "${FILESDIR}/libvirtd.confd-r5" libvirtd
newconfd "${FILESDIR}/libvirt-guests.confd" libvirt-guests
default
# Tweak the init script:
- cp "${FILESDIR}/libvirtd.init-r18" "${S}/libvirtd.init" || die
+ cp "${FILESDIR}/libvirtd.init-r19" "${S}/libvirtd.init" || die
sed -e "s/USE_FLAG_FIREWALLD/$(usex firewalld 'need firewalld' '')/" \
-i "${S}/libvirtd.init" || die "sed failed"
newinitd "${S}/libvirtd.init" libvirtd
newinitd "${FILESDIR}/libvirt-guests.init-r4" libvirt-guests
- newinitd "${FILESDIR}/virtlockd.init-r1" virtlockd
- newinitd "${FILESDIR}/virtlogd.init-r1" virtlogd
+ newinitd "${FILESDIR}/virtlockd.init-r2" virtlockd
+ newinitd "${FILESDIR}/virtlogd.init-r2" virtlogd
newconfd "${FILESDIR}/libvirtd.confd-r5" libvirtd
newconfd "${FILESDIR}/libvirt-guests.confd" libvirt-guests