Set TimeoutStopFailureMode=abort for services

... (see https://fedoraproject.org/wiki/Changes/Shorter_Shutdown_Timer)
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2023-02-22 15:51:59 +01:00
parent 6770ee3c6d
commit 55ee787b77
2 changed files with 23 additions and 3 deletions

14
10-timeout-abort.conf Normal file
View File

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

View File

@ -70,6 +70,7 @@ Source13: libsystemd-shared.abignore
Source14: 10-oomd-defaults.conf Source14: 10-oomd-defaults.conf
Source15: 10-oomd-per-slice-defaults.conf Source15: 10-oomd-per-slice-defaults.conf
Source16: 10-timeout-abort.conf
Source21: macros.sysusers Source21: macros.sysusers
Source22: sysusers.attr Source22: sysusers.attr
@ -536,6 +537,8 @@ package and is meant for use in exitrds.
# Let's disable the service. # Let's disable the service.
sed -r -i '/^enable systemd-boot-update.service/d' presets/90-systemd.preset 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 %build
%global ntpvendor %(source /etc/os-release; echo ${ID}) %global ntpvendor %(source /etc/os-release; echo ${ID})
%{!?ntpvendor: echo 'NTP vendor zone is not set!'; exit 1} %{!?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}/user-.slice.d/ %{SOURCE15}
install -Dm0644 -t %{buildroot}%{system_unit_dir}/system.slice.d/ %{SOURCE15} install -Dm0644 -t %{buildroot}%{system_unit_dir}/system.slice.d/ %{SOURCE15}
install -Dm0644 -t %{buildroot}%{user_unit_dir}/slice.d/ %{SOURCE15} install -Dm0644 -t %{buildroot}%{user_unit_dir}/slice.d/ %{SOURCE15}
# https://fedoraproject.org/wiki/Changes/Shorter_Shutdown_Timer
# https://bugzilla.redhat.com/show_bug.cgi?id=2107754 install -Dm0644 -t %{buildroot}%{system_unit_dir}/service.d/ %{SOURCE16}
install -Dm0644 -t %{buildroot}%{_prefix}/lib/systemd/network/ %{SOURCE25} 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 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}/ %{SOURCE23}
install -m 0755 -D -t %{buildroot}%{_rpmconfigdir}/ %{SOURCE24} 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} %find_lang %{name}
# Split files in build root into rpms. See split-files.py for the # Split files in build root into rpms. See split-files.py for the