Issue

  • We would like to reload CUPS using something like “service cups reload“. This option appears to be missing from the systemd scripts and I can only see a restart option.
  • How can we get CUPS to reload it’s configuration files without restarting it?
  • What will sending a HUP signal to CUPS do?

Resolution

Effects of HUP

Sending the CUPS scheduler (the cupsd process) a “hangup” (HUP) signal will cause cupsd to do the following:

  1. Close any idle client connections and pause listening for new connections.
  2. Wait for up to 30 seconds (the default value for ReloadTimeout in cupsd.conf) for print jobs to complete.
  3. Close all remaining client connections and stop listening for new connections.
  4. Disable all CUPS printer browsing functions. Note that in RHEL 7 and 8, this will not stop cups-browsed from performing its printer discovery and sharing functions.
  5. Flush and close all log, state, and cache files.
  6. Reload the CUPS configuration from the configuration files. During this process, all print queues defined by CUPS will be deleted and recreated.
  7. Start listening for new client connections and start all CUPS printer browsing functions.
  8. Send a notification that the server has started. This should cause cups-browsed (in RHEL 7 and 8) to recreate shared print queues maintained by cups-browsed.
  9. Start processing of all print jobs in the queues.

Sending HUP to CUPS

You can sent the cupsd process a HUP signal to get it to reload its configuration with a command like the following:

Configuring systemd to send HUP

In RHEL 7 and 8, it is also possible to modify the systemd configuration to send a HUP signal to CUPS by by adding “ExecReload=/bin/kill -HUP $MAINPID” to the systemd service file. To do this:

  1. Make a copy of the systemd service file:
  2. Edit /etc/systemd/system/cups.service to add the line:

    in the [Service] section of the file.

  3. Reload the systemd configuration:

After this, you should be able to reload CUPS by running either of the following commands: