[Kimchi-devel] [PATCH] Update Wok and Kimchi systemd process.

Paulo Ricardo Paz Vital pvital at linux.vnet.ibm.com
Thu Oct 15 12:39:05 UTC 2015


Aline, addressing both questions in one answer.

May be the name of the file kimchid.service.fedora is not a good name,
but there is no Kimchi service. We will work only with Wok service. The
kimchid.service.fedora file is a configuration extension for the
wokd.service, where after the installation of the kimchid.service.fedor
a will provide the information to wokd.service that libvirtd is
required.

Let'me try to explain how it works using a use case. The user will
install the RPM or DEB file of Wok, only. This will enable the wokd
service in systemd. Starting the service, libvirtd will not be
required.

Then, the user installs the RPM or DEB file of Kimchi. This will
install an additional file in /etc/systemd/system/wokd.service.d called
kimchi.conf that extends how wokd.service will works after the
installation of Kimchi. At this point, wokd.service will read this
configuration file and used it to start up the service, now requeiring
libvirtd as required service.

If user uninstall the RPM or DEB file of Kimchi, this configuration
file will be deleted and libvirtd will not be required anymore to
wokd.service.

With this approach I can extend wokd service to work with any kind of
plugin I want to use in my system, by configuring only those
requirements and particularities that each plugin needs.

Best regards,
Paulo

On Wed, 2015-10-14 at 18:48 -0300, Aline Manera wrote:
> 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 at linux.vnet.ibm.com wrote:
> > From: Paulo Vital <pvital at 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 at 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,is
> > os,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
> 
-- 
--
Paulo Ricardo Paz Vital
IBM Linux Technology Center




More information about the Kimchi-devel mailing list