From f4b1c020a2c8493473bf868231cee6a952d57e6f Mon Sep 17 00:00:00 2001 From: Ryan Moeller Date: Sat, 22 Feb 2020 00:01:39 -0500 Subject: [PATCH] Add virtlockd and virtlogd init scripts These are missing files for OpenRC. Signed-off-by: Ryan Moeller Signed-off-by: Michal Privoznik Reviewed-by: Michal Privoznik --- src/locking/Makefile.inc.am | 9 +++++++++ src/locking/virtlockd.init.in | 24 ++++++++++++++++++++++++ src/logging/Makefile.inc.am | 10 ++++++++++ src/logging/virtlogd.init.in | 24 ++++++++++++++++++++++++ 4 files changed, 67 insertions(+) create mode 100644 src/locking/virtlockd.init.in create mode 100644 src/logging/virtlogd.init.in diff --git a/src/locking/Makefile.inc.am b/src/locking/Makefile.inc.am index e663d7146b..d0e36705b2 100644 --- a/src/locking/Makefile.inc.am +++ b/src/locking/Makefile.inc.am @@ -79,6 +79,13 @@ VIRTLOCKD_UNIT_FILES_IN = \ SYSTEMD_UNIT_FILES += $(notdir $(VIRTLOCKD_UNIT_FILES_IN:%.in=%)) SYSTEMD_UNIT_FILES_IN += $(VIRTLOCKD_UNIT_FILES_IN) +OPENRC_INIT_FILES += \ + virtlockd.init \ + $(NULL) +OPENRC_INIT_FILES_IN += \ + virtlockd.init.in \ + $(NULL) + noinst_LTLIBRARIES += libvirt_driver_lock.la libvirt_la_BUILT_LIBADD += libvirt_driver_lock.la @@ -275,6 +282,8 @@ locking/lock_daemon_dispatch_stubs.h: $(LOCK_PROTOCOL) \ virLockSpaceProtocol VIR_LOCK_SPACE_PROTOCOL \ $(LOCK_PROTOCOL) > locking/lock_daemon_dispatch_stubs.h +virtlockd.init: locking/virtlockd.init.in $(top_builddir)/config.status + $(AM_V_GEN)$(SED) $(COMMON_UNIT_VARS) $< > $@-t && mv $@-t $@ virtlockd.service: locking/virtlockd.service.in $(top_builddir)/config.status $(AM_V_GEN)sed $(COMMON_UNIT_VARS) $< > $@-t && mv $@-t $@ diff --git a/src/locking/virtlockd.init.in b/src/locking/virtlockd.init.in new file mode 100644 index 0000000000..e5264fd211 --- /dev/null +++ b/src/locking/virtlockd.init.in @@ -0,0 +1,24 @@ +#!/sbin/openrc-run + +description="Virtualization locking daemon" + +VIRTLOCKD_OPTS=${VIRTLOCKD_OPTS:-"${VIRTLOCKD_OPTS}"} + +command="@sbindir@/virtlockd" +command_args="${VIRTLOCKD_OPTS}" +supervisor="supervise-daemon" + +extra_started_commands="reload" +description_reload="re-exec the daemon to enforce configuration reload" + +depend() { + keyword -shutdown + after nfs nfsmount +} + +reload() { + ebegin "re-exec() virtlockd" + + ${supervisor} ${RC_SVCNAME} --signal HUP + eend $? +} diff --git a/src/logging/Makefile.inc.am b/src/logging/Makefile.inc.am index c4fa49106e..083d8773cb 100644 --- a/src/logging/Makefile.inc.am +++ b/src/logging/Makefile.inc.am @@ -55,6 +55,13 @@ VIRTLOGD_UNIT_FILES_IN = \ SYSTEMD_UNIT_FILES += $(notdir $(VIRTLOGD_UNIT_FILES_IN:%.in=%)) SYSTEMD_UNIT_FILES_IN += $(VIRTLOGD_UNIT_FILES_IN) +OPENRC_INIT_FILES += \ + virtlogd.init \ + $(NULL) +OPENRC_INIT_FILES_IN += \ + virtlogd.init.in \ + $(NULL) + noinst_LTLIBRARIES += libvirt_driver_log.la libvirt_la_BUILT_LIBADD += libvirt_driver_log.la @@ -126,6 +133,9 @@ logging/log_daemon_dispatch_stubs.h: $(LOG_PROTOCOL) \ virLogManagerProtocol VIR_LOG_MANAGER_PROTOCOL \ $(LOG_PROTOCOL) > logging/log_daemon_dispatch_stubs.h +virtlogd.init: logging/virtlogd.init.in $(top_builddir)/config.status + $(AM_V_GEN)$(SED) $(COMMON_UNIT_VARS) $< > $@-t && mv $@-t $@ + virtlogd.service: logging/virtlogd.service.in $(top_builddir)/config.status $(AM_V_GEN)sed $(COMMON_UNIT_VARS) $< > $@-t && mv $@-t $@ diff --git a/src/logging/virtlogd.init.in b/src/logging/virtlogd.init.in new file mode 100644 index 0000000000..4f804f42d7 --- /dev/null +++ b/src/logging/virtlogd.init.in @@ -0,0 +1,24 @@ +#!/sbin/openrc-run + +description="Virtualization logging daemon" + +VIRTLOGD_OPTS=${VIRTLOGD_OPTS:-"${VIRTLOGD_OPTS}"} + +command="@sbindir@/virtlogd" +command_args="${VIRTLOGD_OPTS}" +supervisor="supervise-daemon" + +extra_started_commands="reload" +description_reload="re-exec the daemon to enforce configuration reload" + +depend() { + keyword -shutdown + after nfs nfsmount +} + +reload() { + ebegin "re-exec() virtlogd" + + ${supervisor} ${RC_SVCNAME} --signal HUP + eend $? +} -- GitLab