files /etc/cups/subscriptions.conf* recreated all the time?

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
kaefert
Level 3
Level 3
Posts: 110
Joined: Sun Jan 08, 2012 12:08 pm

files /etc/cups/subscriptions.conf* recreated all the time?

Post by kaefert »

Why are those two files recreated all the time (every few minutes) without anybody touching the printer settings GUI?

Code: Select all

# stat /etc/cups/subscriptions.conf*
  File: /etc/cups/subscriptions.conf
  Size: 1822            Blocks: 8          IO Block: 4096   regular file
Device: 1eh/30d Inode: 758244      Links: 1
Access: (0640/-rw-r-----)  Uid: (    0/    root)   Gid: (    7/      lp)
Access: 2021-08-01 18:07:52.057472409 +0200
Modify: 2021-08-01 18:07:52.057472409 +0200
Change: 2021-08-01 18:07:52.065472556 +0200
 Birth: -
  File: /etc/cups/subscriptions.conf.O
  Size: 1532            Blocks: 8          IO Block: 4096   regular file
Device: 1eh/30d Inode: 758243      Links: 1
Access: (0640/-rw-r-----)  Uid: (    0/    root)   Gid: (    7/      lp)
Access: 2021-08-01 18:07:10.688719217 +0200
Modify: 2021-08-01 18:07:10.688719217 +0200
Change: 2021-08-01 18:07:52.065472556 +0200
 Birth: -
 
Can I change the CUPS configuration in a way to prevent this without losing printer functionality?

(Should this question be posted in Hardware Support -> Printers & Scanners instead? I was unsure, since this is not really a question about hardware.)
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Moonstone Man
Level 16
Level 16
Posts: 6054
Joined: Mon Aug 27, 2012 10:17 pm

Re: files /etc/cups/subscriptions.conf* recreated all the time?

Post by Moonstone Man »

kaefert wrote: Sun Aug 01, 2021 12:23 pm Why are those two files recreated all the time (every few minutes)
There is no evidence in your post that "those two files [are] recreated all the time (every few minutes)" so there's nothing be said.

Inspecting the files will tell you what events are subscribed to. As for what might be causing the files to be rewritten often, it's possibly a short lease time handed out by the DHCP server, but since you don't provide the file's content, nor any evidence of the rewrite interval, that's just a pot-luck wild guess, which is all you can expect when you don't provide sufficient information.
kaefert
Level 3
Level 3
Posts: 110
Joined: Sun Jan 08, 2012 12:08 pm

Re: files /etc/cups/subscriptions.conf* recreated all the time?

Post by kaefert »

Hah! Sorry, I didn't know I need to prove it ;)

I use btrbk (with snapshot_create onchange option) to make incremental backups of my btrfs subvolumes to external harddisks, and since I use a separate subvolume for /var I thought the root partition should not see any changes except for systemupdates or configuration changes. This was a wrong assumption, and showing the difference between my snapshots, I can see most changes come down to /etc/cups/subscriptions.conf and /etc/cups/subscriptions.conf.0

For example:

Code: Select all

# btrfs send --no-data -p /.btrfs_root_hdd/@ssd_backups/@.20210802T070001+0200 /.btrfs_root_hdd/@ssd_backups/@.20210802T080001+0200 | btrfs receive --dump
At subvol /.btrfs_root_hdd/@ssd_backups/@.20210802T080001+0200
snapshot        ./@.20210802T080001+0200        uuid=71c7c6c1-7f7c-7b41-aa34-05c962aba2c6 transid=138110 parent_uuid=f46565e2-2601-474a-abfb-7bd2b9ee4ee1 parent_transid=137824
utimes          ./@.20210802T080001+0200/       atime=2021-07-31T22:25:11+0200 mtime=2021-08-02T07:34:01+0200 ctime=2021-08-02T07:34:01+0200
utimes          ./@.20210802T080001+0200/tmp    atime=2021-07-03T15:00:06+0200 mtime=2021-08-02T07:37:46+0200 ctime=2021-08-02T07:38:02+0200
utimes          ./@.20210802T080001+0200/etc/cups atime=2021-07-18T12:46:41+0200 mtime=2021-08-02T07:32:15+0200 ctime=2021-08-02T07:34:01+0200
unlink          ./@.20210802T080001+0200/etc/cups/subscriptions.conf.O
utimes          ./@.20210802T080001+0200/etc/cups atime=2021-07-18T12:46:41+0200 mtime=2021-08-02T07:32:15+0200 ctime=2021-08-02T07:34:01+0200
link            ./@.20210802T080001+0200/etc/cups/subscriptions.conf.O dest=etc/cups/subscriptions.conf
unlink          ./@.20210802T080001+0200/etc/cups/subscriptions.conf
utimes          ./@.20210802T080001+0200/etc/cups atime=2021-07-18T12:46:41+0200 mtime=2021-08-02T07:32:15+0200 ctime=2021-08-02T07:34:01+0200
utimes          ./@.20210802T080001+0200/etc/cups atime=2021-07-18T12:46:41+0200 mtime=2021-08-02T07:32:15+0200 ctime=2021-08-02T07:34:01+0200
utimes          ./@.20210802T080001+0200/etc/cups/subscriptions.conf.O atime=2021-08-02T06:33:55+0200 mtime=2021-08-02T06:33:55+0200 ctime=2021-08-02T07:34:01+0200
mkfile          ./@.20210802T080001+0200/o510606-138084-0
rename          ./@.20210802T080001+0200/o510606-138084-0 dest=./@.20210802T080001+0200/etc/cups/subscriptions.conf
utimes          ./@.20210802T080001+0200/etc/cups atime=2021-07-18T12:46:41+0200 mtime=2021-08-02T07:32:15+0200 ctime=2021-08-02T07:34:01+0200
update_extent   ./@.20210802T080001+0200/etc/cups/subscriptions.conf offset=0 len=1531
chown           ./@.20210802T080001+0200/etc/cups/subscriptions.conf gid=7 uid=0
chmod           ./@.20210802T080001+0200/etc/cups/subscriptions.conf mode=640
utimes          ./@.20210802T080001+0200/etc/cups/subscriptions.conf atime=2021-08-02T07:32:15+0200 mtime=2021-08-02T07:32:15+0200 ctime=2021-08-02T07:34:01+0200
The contents of /etc/cups/subscriptions.conf (at the moment) are:

Code: Select all

# Subscription configuration file for CUPS v2.3.1
# Written by cupsd
NextSubscriptionId 86
<Subscription 74>
Events printer-state-changed printer-restarted printer-shutdown printer-stopped printer-added printer-deleted job-state-changed job-created job-completed job-stopped
Owner username
Recipient dbus://
LeaseDuration 3600
Interval 0
ExpirationTime 1627885904
NextEventId 6
</Subscription>
<Subscription 78>
Events printer-state-changed printer-restarted printer-shutdown printer-stopped printer-added printer-deleted printer-modified
Owner username
LeaseDuration 86400
Interval 0
ExpirationTime 1627914802
NextEventId 4
</Subscription>
<Subscription 79>
Events printer-state-changed printer-restarted printer-shutdown printer-stopped printer-added printer-deleted printer-modified job-state-changed job-created job-completed job-stopped job-progress
Owner username
LeaseDuration 86400
Interval 0
ExpirationTime 1627914813
NextEventId 2
</Subscription>
<Subscription 80>
Events printer-changed
Owner root
LeaseDuration 86400
Interval 60
ExpirationTime 1627915031
NextEventId 1
</Subscription>
<Subscription 81>
Events all
Owner anonymous
Recipient dbus://
LeaseDuration 86400
Interval 0
ExpirationTime 1627915031
NextEventId 5
</Subscription>
<Subscription 84>
Events printer-changed
Owner root
LeaseDuration 86400
Interval 60
ExpirationTime 1627941600
NextEventId 1
</Subscription>
<Subscription 85>
Events all
Owner anonymous
Recipient dbus://
LeaseDuration 86400
Interval 0
ExpirationTime 1627941600
NextEventId 1
</Subscription>
By "Inspecting the files" you mean comparing the contents what is changing? In this example between today 08:00 shown above and an hour earlier, at 07:00 line 10 was this:

Code: Select all

ExpirationTime 1627882404
Locked

Return to “Software & Applications”