diff --git a/0001-systemd-clevis-luks-askpass-exit-cleanly-with-SIGTER.patch b/0001-systemd-clevis-luks-askpass-exit-cleanly-with-SIGTER.patch new file mode 100644 index 0000000..c9dd402 --- /dev/null +++ b/0001-systemd-clevis-luks-askpass-exit-cleanly-with-SIGTER.patch @@ -0,0 +1,33 @@ +From 6eba228a763ea319a8f0a9b9ba1e76e66cef733c Mon Sep 17 00:00:00 2001 +From: Sergio Correia +Date: Sat, 5 Sep 2020 09:09:06 -0300 +Subject: [PATCH] systemd: clevis-luks-askpass: exit cleanly with SIGTERM + +Especially when running in early boot, clevis-luks-askpass may be +looping because e.g. we still have devices remaining to unlock, as +per crypttab, or we were unable to determine if there are any devices +left to be unlocked. + +Eventually we may receive a SIGTERM, from e.g. systemd and we should +exit cleanly in this situation. +--- + src/luks/systemd/clevis-luks-askpass | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/src/luks/systemd/clevis-luks-askpass b/src/luks/systemd/clevis-luks-askpass +index d17d122..285bba4 100755 +--- a/src/luks/systemd/clevis-luks-askpass ++++ b/src/luks/systemd/clevis-luks-askpass +@@ -22,6 +22,9 @@ set -eu + + . clevis-luks-common-functions + ++# Make sure to exit cleanly if SIGTERM is received. ++trap 'echo "Exiting due to SIGTERM" && exit 0' TERM ++ + loop= + path=/run/systemd/ask-password + while getopts ":lp:" o; do +-- +2.28.0 + diff --git a/clevis.spec b/clevis.spec index 47462eb..bf7adb6 100644 --- a/clevis.spec +++ b/clevis.spec @@ -1,12 +1,14 @@ Name: clevis Version: 14 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Automated decryption framework License: GPLv3+ URL: https://github.com/latchset/%{name} Source0: https://github.com/latchset/%{name}/releases/download/v%{version}/%{name}-%{version}.tar.xz +Patch0001: 0001-systemd-clevis-luks-askpass-exit-cleanly-with-SIGTER.patch + BuildRequires: git BuildRequires: gcc BuildRequires: meson @@ -182,6 +184,11 @@ exit 0 %attr(4755, root, root) %{_libexecdir}/%{name}-luks-udisks2 %changelog +* Tue Sep 08 2020 Sergio Correia - 14-4 +- Backport upstream PR#230 - clevis-luks-askpass now exits cleanly + when receives a SIGTERM + Resolves: rhbz#1876001 + * Sat Sep 05 2020 Sergio Correia - 14-3 - If clevis-luks-askpass is enabled, it may be using a wrong target, since that changed in v14. Check and update it, if required.