commit:     4dae613a3907917393f52e016b0377f5d1e1b926
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Tue Aug  6 15:25:10 2019 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Tue Aug  6 20:40:32 2019 +0000
URL:        https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=4dae613a

unlock-lucks.sh: Kill running cryptsetup prompt with SIGINT

When using SIGTERM, running terminal would require a "reset"
because cryptsetup cannot restore fds.

Using SIGINT will end cryptsetup prompt gracefully allowing
cryptsetup to restore fds and keep terminal working.

Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>

 defaults/unlock-luks.sh | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/defaults/unlock-luks.sh b/defaults/unlock-luks.sh
index e8f28f6..16e654c 100644
--- a/defaults/unlock-luks.sh
+++ b/defaults/unlock-luks.sh
@@ -116,8 +116,9 @@ main() {
 
        if [ "${crypt_filter_ret}" = '0' ]
        then
-               # Kill any running cryptsetup prompt for this device
-               pkill -9 -f "luksOpen.*${LUKS_NAME}\$" >/dev/null 2>&1
+               # Kill any running cryptsetup prompt for this device.
+               # But SIGINT only to keep shell functional.
+               pkill -2 -f "luksOpen.*${LUKS_NAME}\$" >/dev/null 2>&1
        fi
 }
 

Reply via email to