Package: cryptsetup Version: 2:1.6.6-5
Description: When shutting down Debian Stretch with full disk encryption, an error message appears: Stopping remaining crypto disks sda2_crypt (busy)... and the shutdown process hangs it is a crypto testing setup, with /var & /home on separate encrypted partitions(no LVM), with their keys stored on root partition. During shutdown /lib/cryptsetup/cryptdisks.functions does one pass on parsing crypttab and it's done. System: Debian GNU/Linux stretch/sid Kernel: 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt11-1 (2015-05-24) x86_64 GNU/Linux Libc: Debian GLIBC 2.19-18 I made a patch, that works for me (feel free to improve on it) diff /lib/cryptsetup/cryptdisks.functions.orig /lib/cryptsetup/cryptdisks.functions.new 675a676,677 > elif [ "$INITSTATE" = "remaining" ]; then > return 2 770,774c772,790 < < egrep -v "^[[:space:]]*(#|$)" "$TABFILE" | while read dst src key opts; do < handle_crypttab_line_stop "$dst" "$src" "$key" "$opts" <&3 || log_action_end_msg $? < done 3<&1 < --- > #BUGFIX > ITERATE=1 > while [ "$ITERATE" = "1" ]; do > egrep -v "^[[:space:]]*(#|$)" "$TABFILE" | while read dst src key opts; do > handle_crypttab_line_stop "$dst" "$src" "$key" "$opts" <&3 > STATE=$? > if [ "$STATE" = "0" ]; then > echo "stopped $dst" > ITERATE=0 > elif [ "$STATE" = "1" ]; then > log_action_end_msg $? > ITERATE=0 > elif [ "$STATE" = "2" ]; then > echo "$dst Busy. Retrying..." > sleep 1 > ITERATE=1 > fi > done 3<&1 > done