Cupsd messages littering logs

Good day all,

I have the following messages littering my system logs:

Jun 29 15:27:30 hera cupsd[1882]: Expiring subscriptions...
Jun 29 15:27:31 hera cupsd[1882]: Expiring subscriptions...
Jun 29 15:27:32 hera cupsd[1882]: Expiring subscriptions...
Jun 29 15:27:33 hera cupsd[1882]: Expiring subscriptions...
Jun 29 15:27:34 hera cupsd[1882]: Expiring subscriptions...
Jun 29 15:27:35 hera cupsd[1882]: Expiring subscriptions...
Jun 29 15:27:36 hera cupsd[1882]: Expiring subscriptions...
Jun 29 15:27:37 hera cupsd[1882]: Expiring subscriptions...
Jun 29 15:27:38 hera cupsd[1882]: Expiring subscriptions...
Jun 29 15:27:39 hera cupsd[1882]: Expiring subscriptions...
Jun 29 15:27:40 hera cupsd[1882]: Expiring subscriptions...

Is there a way to disable them? (printing works fine).
My /etc/cups/subscriptions.conf says LeaseDuration 3600 so not sure why this message gets logged every second.

$ nix-info -m
 - system: `"x86_64-linux"`
 - host os: `Linux 5.18.6, NixOS, 22.11 (Raccoon), 22.11pre388062.f2537a505d4`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.9.1`
 - channels(haizaar): `""`
 - channels(root): `"home-manager, nixos"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

I’ve had an item on my todo list for ages to make cups properly socket activated which while not exactly what you’re asking for, should deal with a lot of the cups noise.

Can you share any more info this please?

Currently, CUPS always starts up when configured and the machine powers up. After a while a number of the various daemons will auto-exit due to inactivity, but we don’t actually have to start them in the first place. We can simply use systemd’s support for socket activation and only start things if you’re trying to print something. Of course, when advertising things on the local network, it may get a little trickier (I need to see if we can just advertise it via avahi and then still only start the services when something tries to connect to it), but the case of advertising printers is most likely for when you’re running a print server, in which case you’re probably fine having everything run all the time.

2 Likes

Did you find out more here? I am also affected by this

Nope. I left it as is for now.
For the reference my use-case is just a client printing (no printing servers) hence simple socket activation should do

FWIW, if you have avahi enabled (and don’t require it), one workaround seems to be disabling avahi:

https://github.com/NixOS/nixpkgs/issues/195090

This issue is still current, at least on my machine with nixos-version = 23.11.20230603.9dd2595 (Tapir) and judging by this conversation, possibly because the logic to actually update the JobHistoryUpdate variable called by cupsdCleanJobs is never satisfied. This bug may already have been fixed upstream, but until the fix is received, rather than disable avahi, I’ve found that one solution is to simply restart cups.service. Thereafter, my log will periodically contain the “Expiring subscriptions…” message, but no longer at a 1 Hz frequency :grinning:.

You can filter out these messages with systemd configuration like so:

  systemd.services.cups = {
    overrideStrategy = "asDropin";
    serviceConfig.LogFilterPatterns="~.*Expiring subscriptions.*";
  };