Sometimes Tails cannot shutdown because Tor has not bootstrapped

Once an attempt to connect to Tor has started, it must finish to completion or to failure, otherwise systemd will not finish shutting down the system, instead waiting for tails-wait-until-tor-has-bootstrapped.service.

Failure can occur when there is a captive portal, the network AP does not connect to the internet, or a number of other reasons. When you see the failure screen, the issue here does not occur.

Steps to reproduce on bare metal:

Type 1)

  1. Start Tails
  2. Move past the welcome screen
  3. Connect to a network
  4. When TCA comes up, click to connect to Tor automatically
  5. While Tor is still not connected, go to the top right, click to power off
  6. Soon you will be left on a gray screen, click the escape key
  7. Observe that systemd is waiting for Tor to bootstrap

Type 2)

  1. Start Tails
  2. Move past the welcome screen
  3. Connect to a network
  4. When TCA comes up, click to connect to Tor automatically
  5. While Tor is still not connected, turn off Wi-Fi
  6. Click power off
  7. Soon you will be left on a gray screen, click the escape key
  8. Observe that systemd is waiting for Tor to bootstrap

Neither of these seem to occur when doing an emergency shutdown.

Type 2 here gets me often, for example this can be:

  • I fully connect to Tor
  • I suspend Tails
  • I wake Tails
  • Tails attempts connecting to Tor
  • I prevent it by going offline
  • Do some offline work
  • 1h30m since I woke Tails from being suspended, I finally power off Tails
  • The bug finally bites!
Orginal report I have noticed for some time that every once in a while - I think if I disconnect Wi-Fi before attempting to shut down Tails - that the system will wait for the service `tails-wait-until-tor-has-bootstrapped.service` to finish. The service has no timeout and because it is shutting down, it will obviously never connect.

I cannot recall it ever happening in an emergency shutdown.

Hopefully I will find out how to consistently reproduce this soon.

Edited by Katarzyna Nowak