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