projects/aports·blob master · refs

40 lines · 1.2 KiB

1#!/sbin/openrc-run
2# Copyright 1999-2020 Gentoo Authors
3# Distributed under the terms of the GNU General Public License v2
4
5description="Virtual Machine Management daemon (libvirt)"
6
7LIBVIRTD_OPTS=${LIBVIRTD_OPTS:-"${LIBVIRTD_OPTS}"}
8LIBVIRTD_TIMEOUT=${LIBVIRTD_TERMTIMEOUT:-"TERM/25/KILL/5"}
9
10command="/usr/sbin/libvirtd"
11command_args="${LIBVIRTD_OPTS}"
12start_stop_daemon_args="-b --env KRB5_KTNAME=/etc/libvirt/krb5.tab"
13pidfile="/run/libvirtd.pid"
14retry="${LIBVIRTD_TERMTIMEOUT}"
15
16extra_started_commands="reload"
17
18depend() {
19 need virtlogd
20 use ceph dbus iscsid virtlockd
21 after cgconfig corosync ebtables iptables ip6tables nfs nfsmount ntp-client ntpdportmap rpc.statd sanlock xenconsoled
22}
23
24start_pre() {
25 # Test configuration directories in /etc/libvirt/ to be either not
26 # present or a directory, i.e. not a regular file, bug #532892
27
28 checkpath --directory /etc/libvirt/lxc || return 1
29 checkpath --directory /etc/libvirt/nwfilter || return 1
30 [ -L /etc/libvirt/qemu ] ||
31 checkpath --directory /etc/libvirt/qemu || return 1
32 [ -L /etc/libvirt/storage ] ||
33 checkpath --directory /etc/libvirt/storage || return 1
34}
35
36reload() {
37 ebegin "Reloading $RC_SVCNAME"
38 start-stop-daemon --signal HUP --exec "$command" --pidfile "$pidfile"
39 eend $?
40}