unlock-luks-partition icon indicating copy to clipboard operation
unlock-luks-partition copied to clipboard

Logic is still being executed after successful decryption, displaying unnecessary errors

Open ralienpp opened this issue 3 years ago • 4 comments

Hi, I followed the documented steps on a Debian 11 and I noticed a cosmetic problem.

After the system was decrypted and the boot process is successful, one sees the authentication prompt. However, as the watchdog is still running, it fails to execute some actions that worked well before, when the / partition was still not decrypted and mounted.

Here's what I mean: image

This happens because the watchdog is invoking check_internet(), which in turn attempts to call ping -c 1 google.com > /dev/null 2>&1.

It seems that after the decryption process takes place, the environment changes, and basic file system resources and commands are not available anymore. For example, if I make changes in the script to run ls - then it will say that this is an unknown command.

In your original script, the || exit part is supposed to take care of that - you either run the command, or terminate the script. But on my system the exit part is never reached, because failure occurs when I attempt to run the first command.

My workaround is to do a printf "\033c" somewhere in link-with-server.sh, which clears the screen and removes the errors, so they don't stress the user. However, that doesn't address the root cause of the problem.

p.s. thank you for sharing this recipe, I found it very useful in my projects. You made it very easy to integrate remote unlocking.

ralienpp avatar Feb 21 '22 14:02 ralienpp