On my laptop with Ubuntu 20.04.1 LTS there is sometimes a delay during shutdown, with the message "A stop job is running for Thermal Daemon Service". It looks like this:
Then it just hangs like that until the time 1min 30s has passed, then it finally shuts down. This happens only sometimes, most shutdowns are quick without this happening, but sometimes it comes, seems random.
Why is this happening? How could I get rid of it, or at least get more info about what happens? Does it indicate a bug somewhere?
This is happening, because the Thermal Daemon Services needs "something" for shutdown which is no longer available at the point the service is shutting down. E.g., do you have setup any dependency for any device on the network or something in the config? E.g., some CUPS-printer dependency? If so, if the network is no longer accessible when the daemon shuts down, you get this timeout.
The proper way to fix this is to make sure, via systemd configuration, that the Thermal Daemon is shut down when all dependencies are still met, or that you disable the components causing this delay (e.g., in my above example, you would disable cups-browsed.service).
A more quick and dirty way to "fix" this would be to merely reduce the timeout for thermald upon stopping the services. This does not solve the problem for you, but merely cures the symptoms. You could do this by adding the "TimeoutStopSec" parameter (see here for details) to the [Service] part of the systemd file, or (better!) use
to edit the service configuration.