summaryrefslogtreecommitdiff
path: root/src/interface
diff options
context:
space:
mode:
authorMichal Privoznik <mprivozn@redhat.com>2019-10-31 18:59:19 +0100
committerMichal Privoznik <mprivozn@redhat.com>2019-12-16 10:11:22 +0100
commit49c6fe6201bb8db7689c32b6a2ccf3ee9ce08c0f (patch)
treee13641a995fe32975037fc44d5956372e57e0d9b /src/interface
parent98feb0c4123047953c19f4a4557701eab5555507 (diff)
downloadlibvirt-49c6fe6201bb8db7689c32b6a2ccf3ee9ce08c0f.tar.gz
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>
Diffstat (limited to 'src/interface')
-rw-r--r--src/interface/Makefile.inc.am11
-rw-r--r--src/interface/virtinterfaced.init.in26
2 files changed, 37 insertions, 0 deletions
diff --git a/src/interface/Makefile.inc.am b/src/interface/Makefile.inc.am
index 34acdb7566..3df1d106a7 100644
--- a/src/interface/Makefile.inc.am
+++ b/src/interface/Makefile.inc.am
@@ -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
index 0000000000..4653cb1e16
--- /dev/null
+++ b/src/interface/virtinterfaced.init.in
@@ -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}"
+}