[PATCH] Change systemd KillMode to avoid kill Yum process

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@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

On 26/01/2015 16:48, Rodrigo Trujillo wrote:
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.
Probably we have the same behaviour for Ubuntu and openSUSE. Have you checked them?
Signed-off-by: Rodrigo Trujillo <rodrigo.trujillo@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]

On 01/26/2015 02:38 PM, Aline Manera wrote:
On 26/01/2015 16:48, Rodrigo Trujillo wrote:
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.
Probably we have the same behaviour for Ubuntu and openSUSE. Have you checked them?
Signed-off-by: Rodrigo Trujillo <rodrigo.trujillo@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
We started nginx proxy in kimchi server, will it also be stopped and restarted correctly?
EnvironmentFile=/etc/kimchi/kimchi.conf
[Install]
_______________________________________________ Kimchi-devel mailing list Kimchi-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/kimchi-devel

Not sure, but I guess since nginx process is a child process of kimchid process, in theory, when kimchid process is finished (or 'gracefully' killed) all child process should finish with no problems. On Tue Jan 27 2015 at 8:00:50 AM Royce Lv <lvroyce@linux.vnet.ibm.com> wrote:
On 01/26/2015 02:38 PM, Aline Manera wrote:
On 26/01/2015 16:48, Rodrigo Trujillo wrote:
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.
Probably we have the same behaviour for Ubuntu and openSUSE. Have you checked them?
Signed-off-by: Rodrigo Trujillo <rodrigo.trujillo@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
We started nginx proxy in kimchi server, will it also be stopped and restarted correctly?
EnvironmentFile=/etc/kimchi/kimchi.conf
[Install]
_______________________________________________ Kimchi-devel mailing list Kimchi-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/kimchi-devel
_______________________________________________ Kimchi-devel mailing list Kimchi-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/kimchi-devel
participants (4)
-
Aline Manera
-
Paulo Ricardo Paz Vital
-
Rodrigo Trujillo
-
Royce Lv