Public bug reported:

Bug Report: cupsd.conf corrupted during automatic update with EOF marker left 
in file
Description

During an automatic system update via unattended-upgrades, the
/etc/cups/cupsd.conf configuration file became corrupted. The file
contained a literal EOF marker on line 53, which caused the CUPS service
to fail with the error: "Unable to read /etc/cups/cupsd.conf due to
errors."

The CUPS service would not start, resulting in complete printing unavailability 
until the configuration file was manually repaired.
Steps to Reproduce

    Have a working Ubuntu system with CUPS installed and automatic updates 
enabled
    Wait for unattended-upgrades to perform automatic updates (timing may vary)
    After update, attempt to start CUPS service: sudo systemctl start cups
    Observe failure with error in logs

Note: This appears to be an intermittent issue related to the package update 
process, not easily reproducible on demand.
Expected Behavior

    CUPS configuration files should be preserved or properly merged during 
updates
    The service should continue to work after automatic updates
    No stray markers or corrupted syntax in configuration files

Actual Behavior

    cupsd.conf contained EOF as actual content on line 53
    CUPS service fails to start with configuration syntax error
    Manual intervention required to restore printing functionality

System Information

    OS: Ubuntu 24.04.3 LTS (noble)
    CUPS Version: 2.4.7-1.2ubuntu7.7 (main cups package)
    Related Packages:
        cups-common: 2.4.7-1.2ubuntu7.7
        cups-daemon: 2.4.7-1.2ubuntu7.7
        cups-core-drivers: 2.4.7-1.2ubuntu7.7
    Update Method: unattended-upgrades with default configuration
    Automatic Updates: Enabled (APT::Periodic::Unattended-Upgrade "1")

Configuration File Error

The corrupted file ended with:

EOF ```

The EOF marker (typically used in shell heredoc syntax) was written as literal 
content in the configuration file, causing a syntax error.
Error Messages from Logs

From journalctl -xeu cups.service:

Dez 03 14:42:31 nuc cupsd[1750]: Unable to read "/etc/cups/cupsd.conf" due to 
errors.
Dez 03 14:42:31 nuc systemd[1]: cups.service: Main process exited, code=exited, 
status=1/FAILURE

Impact

Severity: Medium-High (printing completely unavailable)

Frequency: Intermittent (depends on update timing)

Workaround: Manual restoration of configuration file from backup

Affected Users: All users with automatic updates enabled and CUPS
installed

Workaround/Fix Applied

Removed the stray EOF line from /etc/cups/cupsd.conf

Verified configuration with sudo cupsd -t

Restarted CUPS service

Root Cause Analysis

Most likely caused by:

A failed or interrupted configuration file merge during package update

Race condition in configuration file handling during dpkg post-
installation scripts

Issue with configuration file templates or update scripts in the CUPS
package (specifically cups-common or cups-daemon)

Suggestions for Fix

Validation: Add configuration file validation in post-install scripts

Backup: Automatic backup of working configuration before updates

Recovery: Automatic fallback to previous configuration if new one fails
validation

Logging: Better error reporting when configuration updates fail

Safe Write: Use atomic file operations for configuration updates

Additional Information

Original working configuration was backed up as
/etc/cups/cupsd.conf.backup

Error was consistent and reproducible on the affected system until
manually fixed

System logs showed repeated restart attempts by systemd before manual
intervention

Complete CUPS package list from affected system:

cups: 2.4.7-1.2ubuntu7.7
cups-common: 2.4.7-1.2ubuntu7.7
cups-daemon: 2.4.7-1.2ubuntu7.7
cups-core-drivers: 2.4.7-1.2ubuntu7.7

Related Issues

Possibly related to configuration file handling in package managers

May affect other services with complex configuration files during
automatic updates

Could be specific to the cups-common package update process

Reproduction Rate: Intermittent (appears to be timing/race-condition dependent)
Priority: Medium (breaks core printing functionality but has workaround)
Regression Risk: Low (fix would improve robustness)

## This is an Ubuntu/Debian packaging issue

The problem appears to be in the post-installation scripts (`postinst`) of the 
`cups-common` package, not in CUPS itself. During automatic updates via 
`unattended-upgrades`, the configuration file merge process fails and leaves 
stray EOF markers in the configuration file.

## Likely Trigger
The error seems to occur when:
1. `unattended-upgrades` installs CUPS updates
2. The `cups-common.postinst` script runs
3. Something interrupts or fails during configuration file merging
4. Result: `/etc/cups/cupsd.conf` contains literal "EOF"

** Affects: cups (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: cups

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2133850

Title:
  cupsd.conf corrupted during unattended-upgrades with EOF marker in
  file

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cups/+bug/2133850/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to