]> xenbits.xensource.com Git - libvirt.git/commitdiff
configure: Provide OpenRC scripts for sub-daemons
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 31 Oct 2019 17:59:19 +0000 (18:59 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 16 Dec 2019 09:11:22 +0000 (10:11 +0100)
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>
29 files changed:
m4/virt-init-script.m4
src/Makefile.am
src/interface/Makefile.inc.am
src/interface/virtinterfaced.init.in [new file with mode: 0644]
src/libxl/Makefile.inc.am
src/libxl/virtxend.init.in [new file with mode: 0644]
src/lxc/Makefile.inc.am
src/lxc/virtlxcd.init.in [new file with mode: 0644]
src/network/Makefile.inc.am
src/network/virtnetworkd.init.in [new file with mode: 0644]
src/node_device/Makefile.inc.am
src/node_device/virtnodedevd.init.in [new file with mode: 0644]
src/nwfilter/Makefile.inc.am
src/nwfilter/virtnwfilterd.init.in [new file with mode: 0644]
src/qemu/Makefile.inc.am
src/qemu/virtqemud.init.in [new file with mode: 0644]
src/remote/Makefile.inc.am
src/remote/libvirtd.confd [new file with mode: 0644]
src/remote/libvirtd.init.in [new file with mode: 0644]
src/remote/virtproxyd.confd [new file with mode: 0644]
src/remote/virtproxyd.init.in [new file with mode: 0644]
src/secret/Makefile.inc.am
src/secret/virtsecretd.init.in [new file with mode: 0644]
src/storage/Makefile.inc.am
src/storage/virtstoraged.init.in [new file with mode: 0644]
src/vbox/Makefile.inc.am
src/vbox/virtvboxd.init.in [new file with mode: 0644]
src/vz/Makefile.inc.am
src/vz/virtvzd.init.in [new file with mode: 0644]

index 6eb81f04295bb92d9a4c61d6f6b8e2088f17165b..676135866f9e6198cef70b8ea0edaa45ad77a92b 100644 (file)
@@ -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)
 ])
index 0267f16625ac3147c64fa87726d6a27a16ad83a3..013976a2b7f5c094d5a9edd5f56a836ba7d5bdc5 100644 (file)
@@ -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
 
 
index 34acdb75667383578cb1ed618230dd06de48ded3..3df1d106a774a466eb96f80ea2d48b0cd5d2f3d2 100644 (file)
@@ -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 $@
diff --git a/src/interface/virtinterfaced.init.in b/src/interface/virtinterfaced.init.in
new file mode 100644 (file)
index 0000000..4653cb1
--- /dev/null
@@ -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}"
+}
index 03b4d2fad48a9e8e2aa63047f58d593ab610c7eb..5d40724c3bd58ed33ad7970f25e337b56d946f5c 100644 (file)
@@ -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 $@
 
diff --git a/src/libxl/virtxend.init.in b/src/libxl/virtxend.init.in
new file mode 100644 (file)
index 0000000..9159d6b
--- /dev/null
@@ -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}"
+}
index 5eb0bb9ad71eba9c5180828c8a11ecd81b5b229c..26b20e2e0388b1c28ed6823e0dde841a9e097b46 100644 (file)
@@ -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 $@
 
diff --git a/src/lxc/virtlxcd.init.in b/src/lxc/virtlxcd.init.in
new file mode 100644 (file)
index 0000000..48e80c2
--- /dev/null
@@ -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}"
+}
index 1cef1c7bceafdb82413f83c6679b05ab1ff9c208..3eeab742600f05c34f396baa79b7fa2a2285c96a 100644 (file)
@@ -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 $@
diff --git a/src/network/virtnetworkd.init.in b/src/network/virtnetworkd.init.in
new file mode 100644 (file)
index 0000000..7a68319
--- /dev/null
@@ -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}"
+}
index 58077ebddd91bbdd81982ecb27dd4c1e693f81b4..c29397464be68352a70eb634c6ac4f74e57d2aa5 100644 (file)
@@ -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 $@
diff --git a/src/node_device/virtnodedevd.init.in b/src/node_device/virtnodedevd.init.in
new file mode 100644 (file)
index 0000000..8b5f8bb
--- /dev/null
@@ -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}"
+}
index b51c8a5cdaa9680f130b69188e596df16767b8f3..d571d5c713d78da4025d09e692b9622bae5e9e94 100644 (file)
@@ -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 $@
diff --git a/src/nwfilter/virtnwfilterd.init.in b/src/nwfilter/virtnwfilterd.init.in
new file mode 100644 (file)
index 0000000..76a9adf
--- /dev/null
@@ -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}"
+}
index 839b1cacb8493ac29e2e135671ffede5b21cb416..967f6e75a297cb9aded105cf9cd13301298a6dab 100644 (file)
@@ -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 $@
 
diff --git a/src/qemu/virtqemud.init.in b/src/qemu/virtqemud.init.in
new file mode 100644 (file)
index 0000000..b7c385d
--- /dev/null
@@ -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}"
+}
index f648aa4ee4aeea85ba842f5e873d3cefe1cbf45b..b706e5f92fbf1350801e2de85320c388b7f2ae73 100644 (file)
@@ -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 $@
 
diff --git a/src/remote/libvirtd.confd b/src/remote/libvirtd.confd
new file mode 100644 (file)
index 0000000..c326531
--- /dev/null
@@ -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"
diff --git a/src/remote/libvirtd.init.in b/src/remote/libvirtd.init.in
new file mode 100644 (file)
index 0000000..b708bef
--- /dev/null
@@ -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}"
+}
diff --git a/src/remote/virtproxyd.confd b/src/remote/virtproxyd.confd
new file mode 100644 (file)
index 0000000..6503c14
--- /dev/null
@@ -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=""
diff --git a/src/remote/virtproxyd.init.in b/src/remote/virtproxyd.init.in
new file mode 100644 (file)
index 0000000..b644c08
--- /dev/null
@@ -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}"
+}
index 959d21099dc6001dc6d4b86ca44bdd4a3aafab98..d332060e380c6c176febb53c0b10ed1c04acfa86 100644 (file)
@@ -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 $@
diff --git a/src/secret/virtsecretd.init.in b/src/secret/virtsecretd.init.in
new file mode 100644 (file)
index 0000000..6deecae
--- /dev/null
@@ -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}"
+}
index 3d453029a736ea656af8289d34df39c0904f54c3..3808079fdef0291d1cb618bb26261e3cf22b50ca 100644 (file)
@@ -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 $@
diff --git a/src/storage/virtstoraged.init.in b/src/storage/virtstoraged.init.in
new file mode 100644 (file)
index 0000000..24e1a68
--- /dev/null
@@ -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}"
+}
index 37da9b0aae5dec52f6c244692f52857885157d13..57f7987dc889f2b94061b3414bab7aa12ff03166 100644 (file)
@@ -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 $@
 
diff --git a/src/vbox/virtvboxd.init.in b/src/vbox/virtvboxd.init.in
new file mode 100644 (file)
index 0000000..dfee040
--- /dev/null
@@ -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}"
+}
index 7dd20e80131317bc48d3c2d0c61332fef7297d2d..e21eab6c921541ae2e976bb1c57f1ac1f551fe6c 100644 (file)
@@ -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 $@
 
diff --git a/src/vz/virtvzd.init.in b/src/vz/virtvzd.init.in
new file mode 100644 (file)
index 0000000..677419a
--- /dev/null
@@ -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}"
+}