Seunghyun Yoo

Posts | Development | About

[EN] A hang on reboot/shutdown when HP printers are installed on Ubuntu/Debian

This post is about how to bypass the problem of having an extremely painful hang (1min 30s) during reboot/shutdown when HP printers are installed on Ubuntu/Debian.

It prints out the message occasionally: A stop job is running for make remote CUPS printers available locally.

The hang is basically caused by the service cups-browsed, which does three main jobs: (1/2) to browse Bonjour/CUPS packets of remote printers and create/remove local raw queues pointing to these printers, (3) to broadcast local queues with the CUPS protocol. The details are described in this link.

I didn’t understand why it requires too much time when the service is going to be terminated. Perhaps this bypassing can cause some unexpected problems if there are on-going printer jobs on the local queue.

Steps:

  1. Open the file ./systemd/system/multi-user.target.wants/cups-browsed.service

  2. Add the line TimeoutStopSec = 1 in the Service section, which limits the maximum waiting time from 1m 30s to 1s.

[Unit]
Description=Make remote CUPS printers available locally
After=cups.service avahi-daemon.service
Wants=cups.service avahi-daemon.service

[Service]
ExecStart=/usr/sbin/cups-browsed
TimeoutStopSec=1

[Install]
WantedBy=multi-user.target

Reference: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=738965