mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-09 01:18:00 +03:00
configure: Provide OpenRC scripts for sub-daemons
There is plenty of distributions that haven't switched to systemd nor they force their users to (Gentoo, Alpine Linux to name a few). With the daemon split merged their only option is to still use the monolithic daemon which will go away eventually. Provide init scripts for these distros too. For now, I'm not introducing config files which would correspond to the init files except for libvirtd and virtproxyd init scripts where it might be desirable to tweak the command line of corresponding daemons. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
98feb0c412
commit
49c6fe6201
@ -19,7 +19,7 @@ dnl
|
||||
|
||||
AC_DEFUN([LIBVIRT_ARG_INIT_SCRIPT],[
|
||||
LIBVIRT_ARG_WITH([INIT_SCRIPT],
|
||||
[Style of init script to install: systemd, check, none],
|
||||
[Style of init script to install: systemd, openrc, check, none],
|
||||
[check])
|
||||
])
|
||||
|
||||
@ -32,12 +32,16 @@ AC_DEFUN([LIBVIRT_CHECK_INIT_SCRIPT],[
|
||||
if test "$with_init_script" = check && type systemctl >/dev/null 2>&1; then
|
||||
with_init_script=systemd
|
||||
fi
|
||||
if test "$with_init_script" = check && type openrc >/dev/null 2>&1; then
|
||||
with_init_script=openrc
|
||||
fi
|
||||
if test "$with_init_script" = check; then
|
||||
with_init_script=none
|
||||
fi
|
||||
|
||||
AS_CASE([$with_init_script],
|
||||
[systemd],[],
|
||||
[openrc],[],
|
||||
[none],[],
|
||||
[*],[
|
||||
AC_MSG_ERROR([Unknown initscript flavour $with_init_script])
|
||||
@ -46,6 +50,8 @@ AC_DEFUN([LIBVIRT_CHECK_INIT_SCRIPT],[
|
||||
|
||||
AM_CONDITIONAL([LIBVIRT_INIT_SCRIPT_SYSTEMD],
|
||||
[test "$with_init_script" = "systemd"])
|
||||
AM_CONDITIONAL([LIBVIRT_INIT_SCRIPT_OPENRC],
|
||||
[test "$with_init_script" = "openrc"])
|
||||
|
||||
AC_MSG_RESULT($with_init_script)
|
||||
])
|
||||
|
@ -84,6 +84,9 @@ RPC_PROBE_FILES =
|
||||
LOGROTATE_FILES_IN =
|
||||
SYSTEMD_UNIT_FILES =
|
||||
SYSTEMD_UNIT_FILES_IN =
|
||||
OPENRC_INIT_FILES =
|
||||
OPENRC_INIT_FILES_IN =
|
||||
OPENRC_CONF_FILES =
|
||||
SYSCONF_FILES =
|
||||
sbin_PROGRAMS =
|
||||
DRIVER_SOURCES =
|
||||
@ -529,7 +532,9 @@ libvirt_lxc_la_LDFLAGS = \
|
||||
libvirt_lxc_la_CFLAGS = $(AM_CFLAGS)
|
||||
libvirt_lxc_la_LIBADD = libvirt.la $(CYGWIN_EXTRA_LIBADD)
|
||||
|
||||
EXTRA_DIST += $(SYSCONF_FILES)
|
||||
EXTRA_DIST += \
|
||||
$(SYSCONF_FILES) \
|
||||
$(OPENRC_CONF_FILES)
|
||||
|
||||
install-sysconfig:
|
||||
$(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysconfig
|
||||
@ -548,6 +553,25 @@ uninstall-sysconfig:
|
||||
done
|
||||
rmdir $(DESTDIR)$(sysconfdir)/sysconfig || :
|
||||
|
||||
OPENRC_CONF_DIR = $(sysconfdir)/conf.d
|
||||
|
||||
install-openrc-conf:
|
||||
$(MKDIR_P) $(DESTDIR)$(OPENRC_CONF_DIR)
|
||||
for f in $(OPENRC_CONF_FILES:%.confd=%) ; \
|
||||
do \
|
||||
tgt=`basename $$f`; \
|
||||
$(INSTALL_DATA) $(srcdir)/$$f.confd \
|
||||
$(DESTDIR)$(OPENRC_CONF_DIR)/$$tgt; \
|
||||
done
|
||||
|
||||
uninstall-openrc-conf:
|
||||
for f in $(OPENRC_CONF_FILES:%.confd=%) ; \
|
||||
do \
|
||||
tgt=`basename $$f`; \
|
||||
rm -f $(DESTDIR)$(OPENRC_CONF_DIR)/$$tgt; \
|
||||
done
|
||||
rmdir $(DESTDIR)$(OPENRC_CONF_DIR) || :
|
||||
|
||||
LOGROTATE_FILES := $(LOGROTATE_FILES_IN:remote/%.in=%)
|
||||
|
||||
EXTRA_DIST += $(LOGROTATE_FILES_IN)
|
||||
@ -582,6 +606,7 @@ endif WITH_LIBVIRTD
|
||||
|
||||
EXTRA_DIST += \
|
||||
$(SYSTEMD_UNIT_FILES_IN) \
|
||||
$(OPENRC_INIT_FILES_IN) \
|
||||
$(NULL)
|
||||
|
||||
|
||||
@ -607,6 +632,35 @@ uninstall-systemd: uninstall-sysconfig
|
||||
INSTALL_DATA_LOCAL += install-systemd
|
||||
UNINSTALL_LOCAL += uninstall-systemd
|
||||
endif LIBVIRT_INIT_SCRIPT_SYSTEMD
|
||||
|
||||
if LIBVIRT_INIT_SCRIPT_OPENRC
|
||||
|
||||
OPENRC_INIT_DIR = $(sysconfdir)/init.d
|
||||
|
||||
BUILT_SOURCES += $(OPENRC_INIT_FILES)
|
||||
DISTCLEANFILES += $(OPENRC_INIT_FILES)
|
||||
|
||||
install-openrc: $(OPENRC_INIT_FILES) install-openrc-conf
|
||||
$(MKDIR_P) $(DESTDIR)$(OPENRC_INIT_DIR)
|
||||
for f in $(OPENRC_INIT_FILES:%.init=%) ; \
|
||||
do \
|
||||
tgt=`basename $$f`; \
|
||||
$(INSTALL_SCRIPT) $$f.init \
|
||||
$(DESTDIR)$(OPENRC_INIT_DIR)/$$tgt ; \
|
||||
done
|
||||
|
||||
uninstall-openrc: uninstall-openrc-conf
|
||||
for f in $(OPENRC_INIT_FILES:%.init=%) ; \
|
||||
do \
|
||||
tgt=`basename $$f`; \
|
||||
rm -f $(DESTDIR)$(OPENRC_INIT_DIR)/$$tgt ; \
|
||||
done
|
||||
rmdir $(DESTDIR)$(OPENRC_INIT_DIR) || :
|
||||
|
||||
INSTALL_DATA_LOCAL += install-openrc
|
||||
UNINSTALL_LOCAL += uninstall-openrc
|
||||
endif LIBVIRT_INIT_SCRIPT_OPENRC
|
||||
|
||||
endif WITH_LIBVIRTD
|
||||
|
||||
|
||||
|
@ -72,6 +72,13 @@ SYSTEMD_UNIT_FILES_IN += \
|
||||
interface/virtinterfaced.service.in \
|
||||
$(NULL)
|
||||
|
||||
OPENRC_INIT_FILES += \
|
||||
virtinterfaced.init \
|
||||
$(NULL)
|
||||
OPENRC_INIT_FILES_IN += \
|
||||
interface/virtinterfaced.init.in \
|
||||
$(NULL)
|
||||
|
||||
VIRTINTERFACED_UNIT_VARS = \
|
||||
$(VIRTD_UNIT_VARS) \
|
||||
-e 's|[@]name[@]|Libvirt interface|g' \
|
||||
@ -79,6 +86,10 @@ VIRTINTERFACED_UNIT_VARS = \
|
||||
-e 's|[@]sockprefix[@]|virtinterfaced|g' \
|
||||
$(NULL)
|
||||
|
||||
virtinterfaced.init: interface/virtinterfaced.init.in \
|
||||
$(top_builddir)/config.status
|
||||
$(AM_V_GEN)$(SED) $(LIBVIRTD_INIT_VARS) $< > $@-t && mv $@-t $@
|
||||
|
||||
virtinterfaced.service: interface/virtinterfaced.service.in \
|
||||
$(top_builddir)/config.status
|
||||
$(AM_V_GEN)$(SED) $(VIRTINTERFACED_UNIT_VARS) $< > $@-t && mv $@-t $@
|
||||
|
26
src/interface/virtinterfaced.init.in
Normal file
26
src/interface/virtinterfaced.init.in
Normal file
@ -0,0 +1,26 @@
|
||||
#!/sbin/openrc-run
|
||||
|
||||
description="Virtualization interface daemon"
|
||||
|
||||
VIRTINTERFACED_OPTS=${VIRTINTERFACED_OPTS:-"${VIRTINTERFACED_OPTS}"}
|
||||
VIRTINTERFACED_TIMEOUT=${VIRTINTERFACED_TERMTIMEOUT:-"TERM/25/KILL/5"}
|
||||
|
||||
command="@sbindir@/virtinterfaced"
|
||||
command_args="-d ${VIRTINTERFACED_OPTS}"
|
||||
pidfile="@runstatedir@/virtinterfaced.pid"
|
||||
retry="${VIRTINTERFACED_TERMTIMEOUT}"
|
||||
|
||||
extra_started_commands="reload"
|
||||
description_reload="re-exec the daemon to enforce configuration reload"
|
||||
|
||||
depend() {
|
||||
use dbus
|
||||
after nfs nfsmount
|
||||
}
|
||||
|
||||
reload() {
|
||||
ebegin "re-exec() virtinterfaced"
|
||||
|
||||
start-stop-daemon --signal SIGHUP \
|
||||
--exec "${command}" --pidfile "${pidfile}"
|
||||
}
|
@ -83,6 +83,13 @@ SYSTEMD_UNIT_FILES_IN += \
|
||||
libxl/virtxend.service.in \
|
||||
$(NULL)
|
||||
|
||||
OPENRC_INIT_FILES += \
|
||||
virtxend.init \
|
||||
$(NULL)
|
||||
OPENRC_INIT_FILES_IN += \
|
||||
libxl/virtxend.init.in \
|
||||
$(NULL)
|
||||
|
||||
LIBXL_UNIT_COND = ConditionPathExists=/proc/xen/capabilities
|
||||
LIBXL_UNIT_CONFLICT = Conflicts=$(LIBVIRTD_SOCKET_UNIT_FILES)
|
||||
|
||||
@ -94,6 +101,9 @@ VIRTXEND_UNIT_VARS = \
|
||||
-e 's|[@]sockprefix[@]|virtxend|g' \
|
||||
$(NULL)
|
||||
|
||||
virtxend.init: libxl/virtxend.init.in $(top_builddir)/config.status
|
||||
$(AM_V_GEN)$(SED) $(LIBVIRTD_INIT_VARS) $< > $@-t && mv $@-t $@
|
||||
|
||||
virtxend.service: libxl/virtxend.service.in $(top_builddir)/config.status
|
||||
$(AM_V_GEN)$(SED) $(VIRTXEND_UNIT_VARS) $< > $@-t && mv $@-t $@
|
||||
|
||||
|
26
src/libxl/virtxend.init.in
Normal file
26
src/libxl/virtxend.init.in
Normal file
@ -0,0 +1,26 @@
|
||||
#!/sbin/openrc-run
|
||||
|
||||
description="Virtualization xen daemon"
|
||||
|
||||
VIRTXEND_OPTS=${VIRTXEND_OPTS:-"${VIRTXEND_OPTS}"}
|
||||
VIRTXEND_TIMEOUT=${VIRTXEND_TERMTIMEOUT:-"TERM/25/KILL/5"}
|
||||
|
||||
command="@sbindir@/virtxend"
|
||||
command_args="-d ${VIRTXEND_OPTS}"
|
||||
pidfile="@runstatedir@/virtxend.pid"
|
||||
retry="${VIRTXEND_TERMTIMEOUT}"
|
||||
|
||||
extra_started_commands="reload"
|
||||
description_reload="re-exec the daemon to enforce configuration reload"
|
||||
|
||||
depend() {
|
||||
use dbus
|
||||
after nfs nfsmount
|
||||
}
|
||||
|
||||
reload() {
|
||||
ebegin "re-exec() virtxend"
|
||||
|
||||
start-stop-daemon --signal SIGHUP \
|
||||
--exec "${command}" --pidfile "${pidfile}"
|
||||
}
|
@ -146,6 +146,13 @@ SYSTEMD_UNIT_FILES_IN += \
|
||||
lxc/virtlxcd.service.in \
|
||||
$(NULL)
|
||||
|
||||
OPENRC_INIT_FILES += \
|
||||
virtlxcd.init \
|
||||
$(NULL)
|
||||
OPENRC_INIT_FILES_IN += \
|
||||
lxc/virtlxcd.init.in \
|
||||
$(NULL)
|
||||
|
||||
VIRTLXCD_UNIT_VARS = \
|
||||
$(VIRTD_UNIT_VARS) \
|
||||
-e 's|[@]name[@]|Libvirt lxc|g' \
|
||||
@ -153,6 +160,9 @@ VIRTLXCD_UNIT_VARS = \
|
||||
-e 's|[@]sockprefix[@]|virtlxcd|g' \
|
||||
$(NULL)
|
||||
|
||||
virtlxcd.init: lxc/virtlxcd.init.in $(top_builddir)/config.status
|
||||
$(AM_V_GEN)$(SED) $(LIBVIRTD_INIT_VARS) $< > $@-t && mv $@-t $@
|
||||
|
||||
virtlxcd.service: lxc/virtlxcd.service.in $(top_builddir)/config.status
|
||||
$(AM_V_GEN)$(SED) $(VIRTLXCD_UNIT_VARS) $< > $@-t && mv $@-t $@
|
||||
|
||||
|
26
src/lxc/virtlxcd.init.in
Normal file
26
src/lxc/virtlxcd.init.in
Normal file
@ -0,0 +1,26 @@
|
||||
#!/sbin/openrc-run
|
||||
|
||||
description="Virtualization lxc daemon"
|
||||
|
||||
VIRTLXCD_OPTS=${VIRTLXCD_OPTS:-"${VIRTLXCD_OPTS}"}
|
||||
VIRTLXCD_TIMEOUT=${VIRTLXCD_TERMTIMEOUT:-"TERM/25/KILL/5"}
|
||||
|
||||
command="@sbindir@/virtlxcd"
|
||||
command_args="-d ${VIRTLXCD_OPTS}"
|
||||
pidfile="@runstatedir@/virtlxcd.pid"
|
||||
retry="${VIRTLXCD_TERMTIMEOUT}"
|
||||
|
||||
extra_started_commands="reload"
|
||||
description_reload="re-exec the daemon to enforce configuration reload"
|
||||
|
||||
depend() {
|
||||
use ceph dbus iscsid virtlockd
|
||||
after nfs nfsmount
|
||||
}
|
||||
|
||||
reload() {
|
||||
ebegin "re-exec() virtlxcd"
|
||||
|
||||
start-stop-daemon --signal SIGHUP \
|
||||
--exec "${command}" --pidfile "${pidfile}"
|
||||
}
|
@ -80,6 +80,13 @@ SYSTEMD_UNIT_FILES_IN += \
|
||||
network/virtnetworkd.service.in \
|
||||
$(NULL)
|
||||
|
||||
OPENRC_INIT_FILES += \
|
||||
virtnetworkd.init \
|
||||
$(NULL)
|
||||
OPENRC_INIT_FILES_IN += \
|
||||
network/virtnetworkd.init.in \
|
||||
$(NULL)
|
||||
|
||||
VIRTNETWORKD_UNIT_VARS = \
|
||||
$(VIRTD_UNIT_VARS) \
|
||||
-e 's|[@]name[@]|Libvirt network|g' \
|
||||
@ -87,6 +94,9 @@ VIRTNETWORKD_UNIT_VARS = \
|
||||
-e 's|[@]sockprefix[@]|virtnetworkd|g' \
|
||||
$(NULL)
|
||||
|
||||
virtnetworkd.init: network/virtnetworkd.init.in $(top_builddir)/config.status
|
||||
$(AM_V_GEN)$(SED) $(LIBVIRTD_INIT_VARS) $< > $@-t && mv $@-t $@
|
||||
|
||||
virtnetworkd.service: network/virtnetworkd.service.in \
|
||||
$(top_builddir)/config.status
|
||||
$(AM_V_GEN)$(SED) $(VIRTNETWORKD_UNIT_VARS) $< > $@-t && mv $@-t $@
|
||||
|
26
src/network/virtnetworkd.init.in
Normal file
26
src/network/virtnetworkd.init.in
Normal file
@ -0,0 +1,26 @@
|
||||
#!/sbin/openrc-run
|
||||
|
||||
description="Virtualization network daemon"
|
||||
|
||||
VIRTNETWORKD_OPTS=${VIRTNETWORKD_OPTS:-"${VIRTNETWORKD_OPTS}"}
|
||||
VIRTNETWORKD_TIMEOUT=${VIRTNETWORKD_TERMTIMEOUT:-"TERM/25/KILL/5"}
|
||||
|
||||
command="@sbindir@/virtnetworkd"
|
||||
command_args="-d ${VIRTNETWORKD_OPTS}"
|
||||
pidfile="@runstatedir@/virtnetworkd.pid"
|
||||
retry="${VIRTNETWORKD_TERMTIMEOUT}"
|
||||
|
||||
extra_started_commands="reload"
|
||||
description_reload="re-exec the daemon to enforce configuration reload"
|
||||
|
||||
depend() {
|
||||
use ceph dbus iscsid virtlockd
|
||||
after nfs nfsmount
|
||||
}
|
||||
|
||||
reload() {
|
||||
ebegin "re-exec() virtnetworkd"
|
||||
|
||||
start-stop-daemon --signal SIGHUP \
|
||||
--exec "${command}" --pidfile "${pidfile}"
|
||||
}
|
@ -96,6 +96,13 @@ SYSTEMD_UNIT_FILES_IN += \
|
||||
node_device/virtnodedevd.service.in \
|
||||
$(NULL)
|
||||
|
||||
OPENRC_INIT_FILES += \
|
||||
virtnodedevd.init \
|
||||
$(NULL)
|
||||
OPENRC_INIT_FILES_IN += \
|
||||
node_device/virtnodedevd.init.in \
|
||||
$(NULL)
|
||||
|
||||
VIRTNODEDEVD_UNIT_VARS = \
|
||||
$(VIRTD_UNIT_VARS) \
|
||||
-e 's|[@]name[@]|Libvirt nodedev|g' \
|
||||
@ -103,6 +110,10 @@ VIRTNODEDEVD_UNIT_VARS = \
|
||||
-e 's|[@]sockprefix[@]|virtnodedevd|g' \
|
||||
$(NULL)
|
||||
|
||||
virtnodedevd.init: node_device/virtnodedevd.init.in \
|
||||
$(top_builddir)/config.status
|
||||
$(AM_V_GEN)$(SED) $(LIBVIRTD_INIT_VARS) $< > $@-t && mv $@-t $@
|
||||
|
||||
virtnodedevd.service: node_device/virtnodedevd.service.in \
|
||||
$(top_builddir)/config.status
|
||||
$(AM_V_GEN)$(SED) $(VIRTNODEDEVD_UNIT_VARS) $< > $@-t && mv $@-t $@
|
||||
|
26
src/node_device/virtnodedevd.init.in
Normal file
26
src/node_device/virtnodedevd.init.in
Normal file
@ -0,0 +1,26 @@
|
||||
#!/sbin/openrc-run
|
||||
|
||||
description="Virtualization nodedev daemon"
|
||||
|
||||
VIRTNODEDEVD_OPTS=${VIRTNODEDEVD_OPTS:-"${VIRTNODEDEVD_OPTS}"}
|
||||
VIRTNODEDEVD_TIMEOUT=${VIRTNODEDEVD_TERMTIMEOUT:-"TERM/25/KILL/5"}
|
||||
|
||||
command="@sbindir@/virtnodedevd"
|
||||
command_args="-d ${VIRTNODEDEVD_OPTS}"
|
||||
pidfile="@runstatedir@/virtnodedevd.pid"
|
||||
retry="${VIRTNODEDEVD_TERMTIMEOUT}"
|
||||
|
||||
extra_started_commands="reload"
|
||||
description_reload="re-exec the daemon to enforce configuration reload"
|
||||
|
||||
depend() {
|
||||
use ceph dbus iscsid virtlockd
|
||||
after nfs nfsmount
|
||||
}
|
||||
|
||||
reload() {
|
||||
ebegin "re-exec() virtnodedevd"
|
||||
|
||||
start-stop-daemon --signal SIGHUP \
|
||||
--exec "${command}" --pidfile "${pidfile}"
|
||||
}
|
@ -81,6 +81,13 @@ SYSTEMD_UNIT_FILES_IN += \
|
||||
nwfilter/virtnwfilterd.service.in \
|
||||
$(NULL)
|
||||
|
||||
OPENRC_INIT_FILES += \
|
||||
virtnwfilterd.init \
|
||||
$(NULL)
|
||||
OPENRC_INIT_FILES_IN += \
|
||||
nwfilter/virtnwfilterd.init.in \
|
||||
$(NULL)
|
||||
|
||||
VIRTNWFILTERD_UNIT_VARS = \
|
||||
$(VIRTD_UNIT_VARS) \
|
||||
-e 's|[@]name[@]|Libvirt nwfilter|g' \
|
||||
@ -88,6 +95,10 @@ VIRTNWFILTERD_UNIT_VARS = \
|
||||
-e 's|[@]sockprefix[@]|virtnwfilterd|g' \
|
||||
$(NULL)
|
||||
|
||||
virtnwfilterd.init: nwfilter/virtnwfilterd.init.in \
|
||||
$(top_builddir)/config.status
|
||||
$(AM_V_GEN)$(SED) $(LIBVIRTD_INIT_VARS) $< > $@-t && mv $@-t $@
|
||||
|
||||
virtnwfilterd.service: nwfilter/virtnwfilterd.service.in \
|
||||
$(top_builddir)/config.status
|
||||
$(AM_V_GEN)$(SED) $(VIRTNWFILTERD_UNIT_VARS) $< > $@-t && mv $@-t $@
|
||||
|
26
src/nwfilter/virtnwfilterd.init.in
Normal file
26
src/nwfilter/virtnwfilterd.init.in
Normal file
@ -0,0 +1,26 @@
|
||||
#!/sbin/openrc-run
|
||||
|
||||
description="Virtualization nwfilter daemon"
|
||||
|
||||
VIRTNWFILTERD_OPTS=${VIRTNWFILTERD_OPTS:-"${VIRTNWFILTERD_OPTS}"}
|
||||
VIRTNWFILTERD_TIMEOUT=${VIRTNWFILTERD_TERMTIMEOUT:-"TERM/25/KILL/5"}
|
||||
|
||||
command="@sbindir@/virtnwfilterd"
|
||||
command_args="-d ${VIRTNWFILTERD_OPTS}"
|
||||
pidfile="@runstatedir@/virtnwfilterd.pid"
|
||||
retry="${VIRTNWFILTERD_TERMTIMEOUT}"
|
||||
|
||||
extra_started_commands="reload"
|
||||
description_reload="re-exec the daemon to enforce configuration reload"
|
||||
|
||||
depend() {
|
||||
use ceph dbus iscsid virtlockd
|
||||
after nfs nfsmount
|
||||
}
|
||||
|
||||
reload() {
|
||||
ebegin "re-exec() virtnwfilterd"
|
||||
|
||||
start-stop-daemon --signal SIGHUP \
|
||||
--exec "${command}" --pidfile "${pidfile}"
|
||||
}
|
@ -154,6 +154,13 @@ SYSTEMD_UNIT_FILES_IN += \
|
||||
qemu/virtqemud.service.in \
|
||||
$(NULL)
|
||||
|
||||
OPENRC_INIT_FILES += \
|
||||
virtqemud.init \
|
||||
$(NULL)
|
||||
OPENRC_INIT_FILES_IN += \
|
||||
qemu/virtqemud.init.in \
|
||||
$(NULL)
|
||||
|
||||
VIRTQEMUD_UNIT_VARS = \
|
||||
$(VIRTD_UNIT_VARS) \
|
||||
-e 's|[@]name[@]|Libvirt qemu|g' \
|
||||
@ -161,6 +168,9 @@ VIRTQEMUD_UNIT_VARS = \
|
||||
-e 's|[@]sockprefix[@]|virtqemud|g' \
|
||||
$(NULL)
|
||||
|
||||
virtqemud.init: qemu/virtqemud.init.in $(top_builddir)/config.status
|
||||
$(AM_V_GEN)$(SED) $(LIBVIRTD_INIT_VARS) $< > $@-t && mv $@-t $@
|
||||
|
||||
virtqemud.service: qemu/virtqemud.service.in $(top_builddir)/config.status
|
||||
$(AM_V_GEN)$(SED) $(VIRTQEMUD_UNIT_VARS) $< > $@-t && mv $@-t $@
|
||||
|
||||
|
26
src/qemu/virtqemud.init.in
Normal file
26
src/qemu/virtqemud.init.in
Normal file
@ -0,0 +1,26 @@
|
||||
#!/sbin/openrc-run
|
||||
|
||||
description="Virtualization qemu daemon"
|
||||
|
||||
VIRTQEMUD_OPTS=${VIRTQEMUD_OPTS:-"${VIRTQEMUD_OPTS}"}
|
||||
VIRTQEMUD_TIMEOUT=${VIRTQEMUD_TERMTIMEOUT:-"TERM/25/KILL/5"}
|
||||
|
||||
command="@sbindir@/virtqemud"
|
||||
command_args="-d ${VIRTQEMUD_OPTS}"
|
||||
pidfile="@runstatedir@/virtqemud.pid"
|
||||
retry="${VIRTQEMUD_TERMTIMEOUT}"
|
||||
|
||||
extra_started_commands="reload"
|
||||
description_reload="re-exec the daemon to enforce configuration reload"
|
||||
|
||||
depend() {
|
||||
use ceph dbus iscsid virtlockd
|
||||
after nfs nfsmount
|
||||
}
|
||||
|
||||
reload() {
|
||||
ebegin "re-exec() virtqemud"
|
||||
|
||||
start-stop-daemon --signal SIGHUP \
|
||||
--exec "${command}" --pidfile "${pidfile}"
|
||||
}
|
@ -126,6 +126,19 @@ SYSTEMD_UNIT_FILES_IN += \
|
||||
$(GUEST_UNIT_FILES_IN) \
|
||||
$(NULL)
|
||||
|
||||
OPENRC_INIT_FILES += \
|
||||
libvirtd.init \
|
||||
virtproxyd.init \
|
||||
$(NULL)
|
||||
OPENRC_INIT_FILES_IN += \
|
||||
remote/libvirtd.init.in \
|
||||
remote/virtproxyd.init.in \
|
||||
$(NULL)
|
||||
OPENRC_CONF_FILES += \
|
||||
remote/libvirtd.confd \
|
||||
remote/virtproxyd.confd \
|
||||
$(NULL)
|
||||
|
||||
REMOTE_PROTOCOL = $(srcdir)/remote/remote_protocol.x
|
||||
LXC_PROTOCOL = $(srcdir)/remote/lxc_protocol.x
|
||||
QEMU_PROTOCOL = $(srcdir)/remote/qemu_protocol.x
|
||||
@ -393,6 +406,17 @@ LIBVIRTD_UNIT_VARS = \
|
||||
-e 's|[@]deps[@]||g' \
|
||||
$(NULL)
|
||||
|
||||
LIBVIRTD_INIT_VARS = \
|
||||
$(COMMON_UNIT_VARS)
|
||||
|
||||
if WITH_FIREWALLD
|
||||
LIBVIRTD_INIT_VARS += \
|
||||
-e 's|[@]NEED_FIREWALLD[@]|need firewalld|g'
|
||||
else ! WITH_FIREWALLD
|
||||
LIBVIRTD_INIT_VARS += \
|
||||
-e 's|[@]NEED_FIREWALLD[@]||g'
|
||||
endif ! WITH_FIREWALLD
|
||||
|
||||
VIRTD_UNIT_VARS = \
|
||||
$(COMMON_UNIT_VARS) \
|
||||
-e 's|[@]deps[@]|Conflicts=$(LIBVIRTD_SOCKET_UNIT_FILES)|g' \
|
||||
@ -405,6 +429,12 @@ VIRTPROXYD_UNIT_VARS = \
|
||||
-e 's|[@]sockprefix[@]|libvirt|g' \
|
||||
$(NULL)
|
||||
|
||||
libvirtd.init: remote/libvirtd.init.in $(top_builddir)/config.status
|
||||
$(AM_V_GEN)$(SED) $(LIBVIRTD_INIT_VARS) $< > $@-t && mv $@-t $@
|
||||
|
||||
virtproxyd.init: remote/virtproxyd.init.in $(top_builddir)/config.status
|
||||
$(AM_V_GEN)$(SED) $(LIBVIRTD_INIT_VARS) $< > $@-t && mv $@-t $@
|
||||
|
||||
libvirtd.service: remote/libvirtd.service.in $(top_builddir)/config.status
|
||||
$(AM_V_GEN)$(SED) $(LIBVIRTD_UNIT_VARS) $< > $@-t && mv $@-t $@
|
||||
|
||||
|
18
src/remote/libvirtd.confd
Normal file
18
src/remote/libvirtd.confd
Normal file
@ -0,0 +1,18 @@
|
||||
# /etc/conf.d/libvirtd
|
||||
|
||||
# Startup dependency
|
||||
# libvirtd typically requires all networks to be up and settled which
|
||||
# is what rc_need="net" provides. However if you only use specific networks
|
||||
# for libvirtd, you may override this. Or if you only use libvirtd locally.
|
||||
rc_need="net"
|
||||
|
||||
# The termination timeout (start-stop-daemon parameter "retry") ensures
|
||||
# that the service will be terminated within a given time (25 + 5 seconds
|
||||
# per default) when you are stopping the service.
|
||||
#LIBVIRTD_TERMTIMEOUT="TERM/25/KILL/5"
|
||||
|
||||
# LIBVIRTD_OPTS
|
||||
# You may want to add '--listen' to have libvirtd listen for tcp/ip connections
|
||||
# if you want to use libvirt for remote control
|
||||
# Please consult 'libvirtd --help' for more options
|
||||
#LIBVIRTD_OPTS="--listen"
|
29
src/remote/libvirtd.init.in
Normal file
29
src/remote/libvirtd.init.in
Normal file
@ -0,0 +1,29 @@
|
||||
#!/sbin/openrc-run
|
||||
|
||||
description="Virtualization daemon"
|
||||
|
||||
LIBVIRTD_OPTS=${LIBVIRTD_OPTS:-"${LIBVIRTD_OPTS}"}
|
||||
LIBVIRTD_TIMEOUT=${LIBVIRTD_TERMTIMEOUT:-"TERM/25/KILL/5"}
|
||||
|
||||
command="@sbindir@/libvirtd"
|
||||
command_args="-d ${LIBVIRTD_OPTS}"
|
||||
start_stop_daemon_args="--env KRB5_KTNAME=/etc/libvirt/krb5.tab"
|
||||
pidfile="@runstatedir@/libvirtd.pid"
|
||||
retry="${LIBVIRTD_TERMTIMEOUT}"
|
||||
|
||||
extra_started_commands="reload"
|
||||
description_reload="re-exec the daemon to enforce configuration reload"
|
||||
|
||||
depend() {
|
||||
need virtlogd
|
||||
@NEED_FIREWALLD@
|
||||
use ceph dbus iscsid virtlockd
|
||||
after cgconfig corosync ebtables iptables ip6tables nfs nfsmount ntp-client ntpdportmap rpc.statd sanlock xenconsoled
|
||||
}
|
||||
|
||||
reload() {
|
||||
ebegin "re-exec() libvirtd"
|
||||
|
||||
start-stop-daemon --signal SIGHUP \
|
||||
--exec "${command}" --pidfile "${pidfile}"
|
||||
}
|
10
src/remote/virtproxyd.confd
Normal file
10
src/remote/virtproxyd.confd
Normal file
@ -0,0 +1,10 @@
|
||||
# /etc/conf.d/virtproxyd
|
||||
|
||||
# The termination timeout (start-stop-daemon parameter "retry") ensures
|
||||
# that the service will be terminated within a given time (25 + 5 seconds
|
||||
# per default) when you are stopping the service.
|
||||
#VIRTPROXYD_TERMTIMEOUT="TERM/25/KILL/5"
|
||||
|
||||
# VIRTPROXYD_OPTS
|
||||
# Please consult 'virtproxyd --help' for more options
|
||||
#VIRTPROXYD_OPTS=""
|
28
src/remote/virtproxyd.init.in
Normal file
28
src/remote/virtproxyd.init.in
Normal file
@ -0,0 +1,28 @@
|
||||
#!/sbin/openrc-run
|
||||
|
||||
description="Virtualization daemon proxy"
|
||||
|
||||
VIRTPROXYD_OPTS=${VIRTPROXYD_OPTS:-"${VIRTPROXYD_OPTS}"}
|
||||
VIRTPROXYD_TIMEOUT=${VIRTPROXYD_TERMTIMEOUT:-"TERM/25/KILL/5"}
|
||||
|
||||
command="@sbindir@/virtproxyd"
|
||||
command_args="-d ${VIRTPROXYD_OPTS}"
|
||||
start_stop_daemon_args="--env KRB5_KTNAME=/etc/libvirt/krb5.tab"
|
||||
pidfile="@runstatedir@/virtproxyd.pid"
|
||||
retry="${VIRTPROXYD_TERMTIMEOUT}"
|
||||
|
||||
extra_started_commands="reload"
|
||||
description_reload="re-exec the daemon to enforce configuration reload"
|
||||
|
||||
depend() {
|
||||
use dbus
|
||||
after cgconfig corosync ebtables iptables ip6tables nfs nfsmount ntp-client ntpdportmap rpc.statd sanlock xenconsoled
|
||||
need net
|
||||
}
|
||||
|
||||
reload() {
|
||||
ebegin "re-exec() virtproxyd"
|
||||
|
||||
start-stop-daemon --signal SIGHUP \
|
||||
--exec "${command}" --pidfile "${pidfile}"
|
||||
}
|
@ -69,6 +69,13 @@ SYSTEMD_UNIT_FILES_IN += \
|
||||
secret/virtsecretd.service.in \
|
||||
$(NULL)
|
||||
|
||||
OPENRC_INIT_FILES += \
|
||||
virtsecretd.init \
|
||||
$(NULL)
|
||||
OPENRC_INIT_FILES_IN += \
|
||||
secret/virtsecretd.init.in \
|
||||
$(NULL)
|
||||
|
||||
VIRTSECRETD_UNIT_VARS = \
|
||||
$(VIRTD_UNIT_VARS) \
|
||||
-e 's|[@]name[@]|Libvirt secret|g' \
|
||||
@ -76,6 +83,9 @@ VIRTSECRETD_UNIT_VARS = \
|
||||
-e 's|[@]sockprefix[@]|virtsecretd|g' \
|
||||
$(NULL)
|
||||
|
||||
virtsecretd.init: secret/virtsecretd.init.in $(top_builddir)/config.status
|
||||
$(AM_V_GEN)$(SED) $(LIBVIRTD_INIT_VARS) $< > $@-t && mv $@-t $@
|
||||
|
||||
virtsecretd.service: secret/virtsecretd.service.in \
|
||||
$(top_builddir)/config.status
|
||||
$(AM_V_GEN)$(SED) $(VIRTSECRETD_UNIT_VARS) $< > $@-t && mv $@-t $@
|
||||
|
26
src/secret/virtsecretd.init.in
Normal file
26
src/secret/virtsecretd.init.in
Normal file
@ -0,0 +1,26 @@
|
||||
#!/sbin/openrc-run
|
||||
|
||||
description="Virtualization secret daemon"
|
||||
|
||||
VIRTSECRETD_OPTS=${VIRTSECRETD_OPTS:-"${VIRTSECRETD_OPTS}"}
|
||||
VIRTSECRETD_TIMEOUT=${VIRTSECRETD_TERMTIMEOUT:-"TERM/25/KILL/5"}
|
||||
|
||||
command="@sbindir@/virtsecretd"
|
||||
command_args="-d ${VIRTSECRETD_OPTS}"
|
||||
pidfile="@runstatedir@/virtsecretd.pid"
|
||||
retry="${VIRTSECRETD_TERMTIMEOUT}"
|
||||
|
||||
extra_started_commands="reload"
|
||||
description_reload="re-exec the daemon to enforce configuration reload"
|
||||
|
||||
depend() {
|
||||
use ceph dbus iscsid virtlockd
|
||||
after nfs nfsmount
|
||||
}
|
||||
|
||||
reload() {
|
||||
ebegin "re-exec() virtsecretd"
|
||||
|
||||
start-stop-daemon --signal SIGHUP \
|
||||
--exec "${command}" --pidfile "${pidfile}"
|
||||
}
|
@ -173,6 +173,13 @@ SYSTEMD_UNIT_FILES_IN += \
|
||||
storage/virtstoraged.service.in \
|
||||
$(NULL)
|
||||
|
||||
OPENRC_INIT_FILES += \
|
||||
virtstoraged.init \
|
||||
$(NULL)
|
||||
OPENRC_INIT_FILES_IN += \
|
||||
storage/virtstoraged.init.in \
|
||||
$(NULL)
|
||||
|
||||
VIRTSTORAGED_UNIT_VARS = \
|
||||
$(VIRTD_UNIT_VARS) \
|
||||
-e 's|[@]name[@]|Libvirt storage|g' \
|
||||
@ -180,6 +187,9 @@ VIRTSTORAGED_UNIT_VARS = \
|
||||
-e 's|[@]sockprefix[@]|virtstoraged|g' \
|
||||
$(NULL)
|
||||
|
||||
virtstoraged.init: storage/virtstoraged.init.in $(top_builddir)/config.status
|
||||
$(AM_V_GEN)$(SED) $(LIBVIRTD_INIT_VARS) $< > $@-t && mv $@-t $@
|
||||
|
||||
virtstoraged.service: storage/virtstoraged.service.in \
|
||||
$(top_builddir)/config.status
|
||||
$(AM_V_GEN)$(SED) $(VIRTSTORAGED_UNIT_VARS) $< > $@-t && mv $@-t $@
|
||||
|
26
src/storage/virtstoraged.init.in
Normal file
26
src/storage/virtstoraged.init.in
Normal file
@ -0,0 +1,26 @@
|
||||
#!/sbin/openrc-run
|
||||
|
||||
description="Virtualization storage daemon"
|
||||
|
||||
VIRTSTORAGED_OPTS=${VIRTSTORAGED_OPTS:-"${VIRTSTORAGED_OPTS}"}
|
||||
VIRTSTORAGED_TIMEOUT=${VIRTSTORAGED_TERMTIMEOUT:-"TERM/25/KILL/5"}
|
||||
|
||||
command="@sbindir@/virtstoraged"
|
||||
command_args="-d ${VIRTSTORAGED_OPTS}"
|
||||
pidfile="@runstatedir@/virtstoraged.pid"
|
||||
retry="${VIRTSTORAGED_TERMTIMEOUT}"
|
||||
|
||||
extra_started_commands="reload"
|
||||
description_reload="re-exec the daemon to enforce configuration reload"
|
||||
|
||||
depend() {
|
||||
use ceph dbus iscsid virtlockd
|
||||
after nfs nfsmount
|
||||
}
|
||||
|
||||
reload() {
|
||||
ebegin "re-exec() virtstoraged"
|
||||
|
||||
start-stop-daemon --signal SIGHUP \
|
||||
--exec "${command}" --pidfile "${pidfile}"
|
||||
}
|
@ -92,6 +92,13 @@ SYSTEMD_UNIT_FILES_IN += \
|
||||
vbox/virtvboxd.service.in \
|
||||
$(NULL)
|
||||
|
||||
OPENRC_INIT_FILES += \
|
||||
virtvboxd.init \
|
||||
$(NULL)
|
||||
OPENRC_INIT_FILES_IN += \
|
||||
vbox/virtvboxd.init.in \
|
||||
$(NULL)
|
||||
|
||||
VIRTVBOXD_UNIT_VARS = \
|
||||
$(VIRTD_UNIT_VARS) \
|
||||
-e 's|[@]name[@]|Libvirt vbox|g' \
|
||||
@ -99,6 +106,9 @@ VIRTVBOXD_UNIT_VARS = \
|
||||
-e 's|[@]sockprefix[@]|virtvboxd|g' \
|
||||
$(NULL)
|
||||
|
||||
virtvboxd.init: vbox/virtvboxd.init.in $(top_builddir)/config.status
|
||||
$(AM_V_GEN)$(SED) $(LIBVIRTD_INIT_VARS) $< > $@-t && mv $@-t $@
|
||||
|
||||
virtvboxd.service: vbox/virtvboxd.service.in $(top_builddir)/config.status
|
||||
$(AM_V_GEN)$(SED) $(VIRTVBOXD_UNIT_VARS) $< > $@-t && mv $@-t $@
|
||||
|
||||
|
26
src/vbox/virtvboxd.init.in
Normal file
26
src/vbox/virtvboxd.init.in
Normal file
@ -0,0 +1,26 @@
|
||||
#!/sbin/openrc-run
|
||||
|
||||
description="Virtualization vbox daemon"
|
||||
|
||||
VIRTVBOXD_OPTS=${VIRTVBOXD_OPTS:-"${VIRTVBOXD_OPTS}"}
|
||||
VIRTVBOXD_TIMEOUT=${VIRTVBOXD_TERMTIMEOUT:-"TERM/25/KILL/5"}
|
||||
|
||||
command="@sbindir@/virtvboxd"
|
||||
command_args="-d ${VIRTVBOXD_OPTS}"
|
||||
pidfile="@runstatedir@/virtvboxd.pid"
|
||||
retry="${VIRTVBOXD_TERMTIMEOUT}"
|
||||
|
||||
extra_started_commands="reload"
|
||||
description_reload="re-exec the daemon to enforce configuration reload"
|
||||
|
||||
depend() {
|
||||
use ceph dbus iscsid virtlockd
|
||||
after nfs nfsmount
|
||||
}
|
||||
|
||||
reload() {
|
||||
ebegin "re-exec() virtvboxd"
|
||||
|
||||
start-stop-daemon --signal SIGHUP \
|
||||
--exec "${command}" --pidfile "${pidfile}"
|
||||
}
|
@ -67,6 +67,13 @@ SYSTEMD_UNIT_FILES_IN += \
|
||||
vz/virtvzd.service.in \
|
||||
$(NULL)
|
||||
|
||||
OPENRC_INIT_FILES += \
|
||||
virtvzd.init \
|
||||
$(NULL)
|
||||
OPENRC_INIT_FILES_IN += \
|
||||
vz/virtvzd.init.in \
|
||||
$(NULL)
|
||||
|
||||
VIRTVZD_UNIT_VARS = \
|
||||
$(VIRTD_UNIT_VARS) \
|
||||
-e 's|[@]name[@]|Libvirt vz|g' \
|
||||
@ -74,6 +81,9 @@ VIRTVZD_UNIT_VARS = \
|
||||
-e 's|[@]sockprefix[@]|virtvzd|g' \
|
||||
$(NULL)
|
||||
|
||||
virtvzd.init: vz/virtvzd.init.in $(top_builddir)/config.status
|
||||
$(AM_V_GEN)$(SED) $(LIBVIRTD_INIT_VARS) $< > $@-t && mv $@-t $@
|
||||
|
||||
virtvzd.service: vz/virtvzd.service.in $(top_builddir)/config.status
|
||||
$(AM_V_GEN)$(SED) $(VIRTVZD_UNIT_VARS) $< > $@-t && mv $@-t $@
|
||||
|
||||
|
26
src/vz/virtvzd.init.in
Normal file
26
src/vz/virtvzd.init.in
Normal file
@ -0,0 +1,26 @@
|
||||
#!/sbin/openrc-run
|
||||
|
||||
description="Virtualization vz daemon"
|
||||
|
||||
VIRTVZD_OPTS=${VIRTVZD_OPTS:-"${VIRTVZD_OPTS}"}
|
||||
VIRTVZD_TIMEOUT=${VIRTVZD_TERMTIMEOUT:-"TERM/25/KILL/5"}
|
||||
|
||||
command="@sbindir@/virtvzd"
|
||||
command_args="-d ${VIRTVZD_OPTS}"
|
||||
pidfile="@runstatedir@/virtvzd.pid"
|
||||
retry="${VIRTVZD_TERMTIMEOUT}"
|
||||
|
||||
extra_started_commands="reload"
|
||||
description_reload="re-exec the daemon to enforce configuration reload"
|
||||
|
||||
depend() {
|
||||
use ceph dbus iscsid virtlockd
|
||||
after nfs nfsmount
|
||||
}
|
||||
|
||||
reload() {
|
||||
ebegin "re-exec() virtvzd"
|
||||
|
||||
start-stop-daemon --signal SIGHUP \
|
||||
--exec "${command}" --pidfile "${pidfile}"
|
||||
}
|
Loading…
Reference in New Issue
Block a user