Hi Paulo,
I am not familiar with systemd config files so I have some questions:
1) The main service now will be wokd. How starting wokd do we make sure
kimchid service will be trigged and then libvirtd service?
2) From my view, with your patch the kimchid service would be the main
which is not true.
Regards,
Aline Manera
On 09/10/2015 08:18, pvital(a)linux.vnet.ibm.com wrote:
From: Paulo Vital <pvital(a)linux.vnet.ibm.com>
Create kimchid.service.fedora as additional configuration of wokd.service to
set the correct start-up of Kimchi dependencies. Also, removed libvirtd.service
as dependency of Wok.
Signed-off-by: Paulo Vital <pvital(a)linux.vnet.ibm.com>
---
contrib/wokd.service.fedora | 2 --
src/wok/plugins/kimchi/Makefile.am | 9 ++++++++-
src/wok/plugins/kimchi/configure.ac | 9 +++++++++
src/wok/plugins/kimchi/contrib/Makefile.am | 6 +++++-
src/wok/plugins/kimchi/contrib/kimchid.service.fedora | 7 +++++++
5 files changed, 29 insertions(+), 4 deletions(-)
create mode 100644 src/wok/plugins/kimchi/contrib/kimchid.service.fedora
diff --git a/contrib/wokd.service.fedora b/contrib/wokd.service.fedora
index 023b1af..33d88d8 100644
--- a/contrib/wokd.service.fedora
+++ b/contrib/wokd.service.fedora
@@ -1,7 +1,5 @@
[Unit]
Description=Wok - Webserver Originated from Kimchi
-Requires=libvirtd.service
-After=libvirtd.service
[Service]
Type=simple
diff --git a/src/wok/plugins/kimchi/Makefile.am b/src/wok/plugins/kimchi/Makefile.am
index 34ddef4..236e96f 100644
--- a/src/wok/plugins/kimchi/Makefile.am
+++ b/src/wok/plugins/kimchi/Makefile.am
@@ -1,7 +1,7 @@
#
# Kimchi
#
-# Copyright IBM Corp, 2013
+# Copyright IBM Corp, 2013-2015
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@@ -139,6 +139,10 @@ ChangeLog:
fi
install-data-local:
+ @if test -d "$(systemdsystemunitdir)" ; then \
+ mkdir -p $(DESTDIR)/etc/systemd/system/wokd.service.d; \
+ $(INSTALL_DATA) contrib/kimchid.service.fedora
$(DESTDIR)/etc/systemd/system/wokd.service.d/kimchi.conf; \
+ fi; \
$(MKDIR_P) $(DESTDIR)/$(localstatedir)/lib/wok/
touch $(DESTDIR)/$(localstatedir)/lib/wok/objectstore
$(MKDIR_P) $(DESTDIR)$(kimchidir)
@@ -147,6 +151,9 @@ install-data-local:
mkdir -p
$(DESTDIR)/$(localstatedir)/lib/wok/plugins/kimchi/{debugreports,isos,screenshots}
uninstall-local:
+ @if test -f $(DESTDIR)/etc/systemd/system/wokd.service.d/kimchi.conf; then \
+ $(RM) $(DESTDIR)/etc/systemd/system/wokd.service.d/kimchi.conf; \
+ fi; \
$(RM) $(DESTDIR)$(kimchidir)/API.json
$(RM) -rf $(DESTDIR)/$(localstatedir)/lib/wok/plugins/kimchi
diff --git a/src/wok/plugins/kimchi/configure.ac b/src/wok/plugins/kimchi/configure.ac
index adab45b..6b334c6 100644
--- a/src/wok/plugins/kimchi/configure.ac
+++ b/src/wok/plugins/kimchi/configure.ac
@@ -64,6 +64,15 @@ else
AC_SUBST([ENABLE_SAMPLE], [False])
fi
+# check for systemd
+PKG_PROG_PKG_CONFIG
+AC_ARG_WITH([systemdsystemunitdir],
+ AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service
files]),
+ [], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir
systemd)])
+if test "x$with_systemdsystemunitdir" != xno; then
+ AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
+fi
+
AC_ARG_WITH(
[spice-html5],
[AS_HELP_STRING([--with-spice-html5],
diff --git a/src/wok/plugins/kimchi/contrib/Makefile.am
b/src/wok/plugins/kimchi/contrib/Makefile.am
index 5001191..d1a4569 100644
--- a/src/wok/plugins/kimchi/contrib/Makefile.am
+++ b/src/wok/plugins/kimchi/contrib/Makefile.am
@@ -1,4 +1,7 @@
-# Copyright IBM Corp, 2013
+#
+# Kimchi
+#
+# Copyright IBM Corp, 2013-2015
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@@ -18,6 +21,7 @@ SUBDIRS = DEBIAN
EXTRA_DIST = \
check_i18n.py \
+ kimchid.service.fedora \
kimchi.spec.fedora.in \
make-deb.sh.in \
$(NULL)
diff --git a/src/wok/plugins/kimchi/contrib/kimchid.service.fedora
b/src/wok/plugins/kimchi/contrib/kimchid.service.fedora
new file mode 100644
index 0000000..cd8e137
--- /dev/null
+++ b/src/wok/plugins/kimchi/contrib/kimchid.service.fedora
@@ -0,0 +1,7 @@
+[Unit]
+Requires=libvirtd.service wokd.service
+After=libvirtd.service wokd.service
+
+[Service]
+Nice=0
+PrivateTmp=yes