[Kimchi-devel] [PATCH] Change systemd KillMode to avoid kill Yum process

Rodrigo Trujillo rodrigo.trujillo at linux.vnet.ibm.com
Mon Jan 26 18:48:27 UTC 2015


Kimchi has a problem when updating itself. Kimchid is restarted and all
children are killed, including Yum. When that happens, the updates are
not finished properly and the system ends up in an inconsistent state.
This patch changes the Systemd KillMode to "process", so, child
processes will remain in the system, letting yum finishes all
transactions in background, while kimchi restarts correctly.

Signed-off-by: Rodrigo Trujillo <rodrigo.trujillo at linux.vnet.ibm.com>
---
 contrib/kimchi.spec.fedora.in  | 6 ++++--
 contrib/kimchid.service.fedora | 2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/contrib/kimchi.spec.fedora.in b/contrib/kimchi.spec.fedora.in
index 92d3e49..4236641 100644
--- a/contrib/kimchi.spec.fedora.in
+++ b/contrib/kimchi.spec.fedora.in
@@ -109,10 +109,12 @@ install -Dm 0755 contrib/kimchid.sysvinit %{buildroot}%{_initrddir}/kimchid
 %post
 if [ $1 -eq 1 ] ; then
     /bin/systemctl enable kimchid.service >/dev/null 2>&1 || :
-    # Initial installation
-    /bin/systemctl daemon-reload >/dev/null 2>&1 || :
 fi
 
+# Reload systemd in initial install and in update, because kimchid.service
+# may have been changed
+/bin/systemctl daemon-reload >/dev/null 2>&1 || :
+
 
 %preun
 
diff --git a/contrib/kimchid.service.fedora b/contrib/kimchid.service.fedora
index 7abe49b..92b8d86 100644
--- a/contrib/kimchid.service.fedora
+++ b/contrib/kimchid.service.fedora
@@ -6,7 +6,7 @@ After=libvirtd.service
 [Service]
 Type=simple
 ExecStart=/usr/bin/kimchid
-ExecStop=/bin/kill -TERM $MAINPID
+KillMode=process
 EnvironmentFile=/etc/kimchi/kimchi.conf
 
 [Install]
-- 
1.9.3




More information about the Kimchi-devel mailing list