Slow shutdown on Ubuntu 16.04 LTS (Stopping thermal daemon/running fit make remote CUPS printers)

After a clean install of Ubuntu 16.04 LTS, I am experiencing very slow shutdowns compared with 15.10. There seems to be one of two processes that hang upon shutdown. Startup is not affected at all. When pressing (esc) the following are shown. Either:

"Stopping thermal daemon services" hangs, or "A stop job is running for remote CUPS printers available locally", before a timer to 1 min 30 seconds is up, after which the machine finally shuts down.

Are there any other people experiencing this? This is most odd. What could be the reasons behind these two hangs?


Solution 1:

I found that the daemon responsible for the CUPS remote printers is the cups-browsed service.

When shutting down, it has a time out of 1m 30s. Stopping this service causes the shutdown process to take only few seconds.

I disabled it using this command line on Ubuntu GNOME 16.04:

sudo systemctl disable cups-browsed.service

And my shutdown process ends in a few seconds.

I got the idea from this Ask Ubuntu answer

Solution 2:

If you depend on network printers, you could simply make systemd a bit more aggressive in stopping the process. By default, it waits up to 1m30s before forcefully shutting things down, but you can just do

$ sudo systemctl edit cups-browsed.service 

and enter

[Service]
TimeoutStopSec=10

to set the timeout down to 10. Then a

$ sudo systemctl daemon-reload 

should make it take effect (or restart your computer).

This works great for me at least.

EDIT: According to Xiaodong Qi's answer, cups-filters 1.11.4 has a fix for this, so upgrading past 17.04 Zesty (which has cups-filters 1.13.4) should be the simplest fix, though as commenters point out this workaround may still be needed :(

Solution 3:

I have got the same Problem. It occurred after clean install Ubuntu 16.04. Finally I figured out, after lots of troubleshooting, that (after disable the Ubuntu boot splash screen) a certain stop-job was running that made the shutdown slow. (Thanks to Alex!) Then I got this error report:

a stop job is running for make remote cups printers available locally

Then I tried this:

sudo systemctl stop cups-browsed.service
sudo systemctl disable cups-browsed.service

To verify:

sudo systemctl status cups-browsed
sudo systemctl is-enabled cups-browsed

and it finally worked! Shutdown was now as good and fast as ever. (You can find this troubleshooting on: "The Annoying Cups Browsed" at the ec-cwang´s Blog!)

This might be important for those this solution is not helpful: How to find out your running stop jobs, just look up: "How do I disable the boot splash screen" on Ask Ubuntu. Then, if you start Ubuntu you get the typical Linux running command signs. If you shut Ubuntu down, mention the output. It shows you at the end what kind of stop job slows down your shutdown procedure.