From 55ee787b7705b4cf94f7e98bdc05e74332b50843 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 22 Feb 2023 15:51:59 +0100 Subject: [PATCH] Set TimeoutStopFailureMode=abort for services ... (see https://fedoraproject.org/wiki/Changes/Shorter_Shutdown_Timer) --- 10-timeout-abort.conf | 14 ++++++++++++++ systemd.spec | 12 +++++++++--- 2 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 10-timeout-abort.conf diff --git a/10-timeout-abort.conf b/10-timeout-abort.conf new file mode 100644 index 0000000..4852648 --- /dev/null +++ b/10-timeout-abort.conf @@ -0,0 +1,14 @@ +# This file is part of the systemd package. +# See https://fedoraproject.org/wiki/Changes/Shorter_Shutdown_Timer. +# +# To facilitate debugging when a service fails to stop cleanly, +# TimeoutStopFailureMode=abort is set to "crash" services that fail to stop in +# the time allotted. This will cause the service to be terminated with SIGABRT +# and a coredump to be generated. +# +# To undo this configuration change, create a mask file: +# sudo mkdir -p /etc/systemd/system/service.d +# sudo ln -sv /dev/null /etc/systemd/system/service.d/10-timeout-abort.conf + +[Service] +TimeoutStopFailureMode=abort diff --git a/systemd.spec b/systemd.spec index b43c856..67b7dc0 100644 --- a/systemd.spec +++ b/systemd.spec @@ -70,6 +70,7 @@ Source13: libsystemd-shared.abignore Source14: 10-oomd-defaults.conf Source15: 10-oomd-per-slice-defaults.conf +Source16: 10-timeout-abort.conf Source21: macros.sysusers Source22: sysusers.attr @@ -536,6 +537,8 @@ package and is meant for use in exitrds. # Let's disable the service. sed -r -i '/^enable systemd-boot-update.service/d' presets/90-systemd.preset +sed -r 's|/system/|/user/|g' %{SOURCE16} >10-timeout-abort.conf.user + %build %global ntpvendor %(source /etc/os-release; echo ${ID}) %{!?ntpvendor: echo 'NTP vendor zone is not set!'; exit 1} @@ -753,9 +756,9 @@ install -Dm0644 -t %{buildroot}%{_prefix}/lib/systemd/oomd.conf.d/ %{SOURCE14} install -Dm0644 -t %{buildroot}%{system_unit_dir}/user-.slice.d/ %{SOURCE15} install -Dm0644 -t %{buildroot}%{system_unit_dir}/system.slice.d/ %{SOURCE15} install -Dm0644 -t %{buildroot}%{user_unit_dir}/slice.d/ %{SOURCE15} - -# https://bugzilla.redhat.com/show_bug.cgi?id=2107754 -install -Dm0644 -t %{buildroot}%{_prefix}/lib/systemd/network/ %{SOURCE25} +# https://fedoraproject.org/wiki/Changes/Shorter_Shutdown_Timer +install -Dm0644 -t %{buildroot}%{system_unit_dir}/service.d/ %{SOURCE16} +install -Dm0644 10-timeout-abort.conf.user %{buildroot}%{user_unit_dir}/service.d/10-timeout-abort.conf sed -i 's|#!/usr/bin/env python3|#!%{__python3}|' %{buildroot}/usr/lib/systemd/tests/run-unit-tests.py @@ -764,6 +767,9 @@ install -m 0644 -D -t %{buildroot}%{_rpmconfigdir}/fileattrs/ %{SOURCE22} install -m 0755 -D -t %{buildroot}%{_rpmconfigdir}/ %{SOURCE23} install -m 0755 -D -t %{buildroot}%{_rpmconfigdir}/ %{SOURCE24} +# https://bugzilla.redhat.com/show_bug.cgi?id=2107754 +install -Dm0644 -t %{buildroot}%{_prefix}/lib/systemd/network/ %{SOURCE25} + %find_lang %{name} # Split files in build root into rpms. See split-files.py for the