- We would like to reload CUPS using something like “
service cups reload“. This option appears to be missing from the
systemdscripts 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
HUPsignal to CUPS do?
Sending the CUPS scheduler (the
cupsd process) a “hangup” (
HUP) signal will cause
cupsd to do the following:
- Close any idle client connections and pause listening for new connections.
- Wait for up to 30 seconds (the default value for
cupsd.conf) for print jobs to complete.
- Close all remaining client connections and stop listening for new connections.
- 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.
- Flush and close all log, state, and cache files.
- Reload the CUPS configuration from the configuration files. During this process, all print queues defined by CUPS will be deleted and recreated.
- Start listening for new client connections and start all CUPS printer browsing functions.
- 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.
- Start processing of all print jobs in the queues.
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:
kill -s HUP $(pidof cupsd)
Configuring systemd to send
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:
- Make a copy of the systemd service file:
12cp /usr/lib/systemd/system/cups.service /etc/systemd/system
/etc/systemd/system/cups.serviceto add the line:12ExecReload=/bin/kill -HUP $MAINPID
[Service]section of the file.
- Reload the
After this, you should be able to reload CUPS by running either of the following commands:
systemctl reload cups.service
service cups reload