New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A quiescent cupsd generates disk activity #1583

Closed
michaelrsweet opened this Issue Apr 21, 2006 · 2 comments

Comments

Projects
None yet
1 participant
@michaelrsweet
Collaborator

michaelrsweet commented Apr 21, 2006

Version: 1.2-current
CUPS.org User: jlovell

A quiescent cupsd generates disk activity which negatively affects battery life. This is already much improved in 1.2, hopefully the attached patch finally silences the battery life dogs ;-)

main.c:
Only re-generate the root certificate if there are client connections.

dirsvc.c:
Use the debug log level when logging remote printer coming and goings.

Comments?
Thanks!

@michaelrsweet

This comment has been minimized.

Collaborator

michaelrsweet commented Apr 22, 2006

CUPS.org User: mike

Fixed in Subversion repository.

@michaelrsweet

This comment has been minimized.

Collaborator

michaelrsweet commented Apr 22, 2006

"battery-helper.patch":

Index: main.c

--- main.c (revision 5446)
+++ main.c (working copy)
@@ -874,6 +874,21 @@
}

/*
  • * Update the root certificate once every 5 minutes if we have client connections...
  • */
  • if ((current_time - RootCertTime) >= RootCertDuration && RootCertDuration &&
  •    !RunUser && cupsArrayCount(Clients))
    
  • {
  • /*
    
  •  \* Update the root certificate...
    
  •  */
    
  •  cupsdDeleteCert(0);
    
  •  cupsdAddCert(0, "root");
    
  • }
  • /*
  • Check for new data on the client sockets...
    */

@@ -993,21 +1008,6 @@
}

/*
  • * Update the root certificate once every 5 minutes...

- */

  • if ((current_time - RootCertTime) >= RootCertDuration && RootCertDuration &&
  •    !RunUser)
    
  • {
  • /*
    
  •  \* Update the root certificate...
    

- */

  •  cupsdDeleteCert(0);
    
  •  cupsdAddCert(0, "root");
    

- }

  • /*
  • Handle OS-specific event notification for any events that have
  • accumulated. Don't send these more than once a second...
    */
    Index: dirsvc.c

    --- dirsvc.c (revision 5446)
    +++ dirsvc.c (working copy)
    @@ -539,7 +539,7 @@
    return;
    }
    else
  • cupsdLogMessage(CUPSD_LOG_INFO, "Saving remote.cache...");
  • cupsdLogMessage(CUPSD_LOG_DEBUG, "Saving remote.cache...");

/*

  • Restrict access to the file...
    @@ -799,7 +799,7 @@
    (p->type & CUPS_PRINTER_CLASS) ? "Class" : "Printer",
    p->name);

  •    cupsdLogMessage(CUPSD_LOG_INFO,
    
  •    cupsdLogMessage(CUPSD_LOG_DEBUG,
                "Remote destination \"%s\" has timed out; "
        "deleting it...",
                p->name);
    

    @@ -1907,7 +1907,7 @@

    if (p->type & CUPS_PRINTER_REMOTE)
    {

  •   cupsdLogMessage(CUPSD_LOG_INFO,
    
  •   cupsdLogMessage(CUPSD_LOG_DEBUG,
                    "Renamed remote class \"%s\" to \"%s@%s\"...",
                    p->name, p->name, p->hostname);
    cupsdAddEvent(CUPSD_EVENT_PRINTER_DELETED, p, NULL,
    

    @@ -1967,7 +1967,7 @@

    p = cupsdAddClass(name);

  •  cupsdLogMessage(CUPSD_LOG_INFO, "Added remote class \"%s\"...", name);
    
  •  cupsdLogMessage(CUPSD_LOG_DEBUG, "Added remote class \"%s\"...", name);
    

    cupsdAddEvent(CUPSD_EVENT_PRINTER_ADDED, p, NULL,
    "Class '%s' added by directory services.", name);
    @@ -2010,7 +2010,7 @@

    if (p->type & CUPS_PRINTER_REMOTE)
    {

  •   cupsdLogMessage(CUPSD_LOG_INFO,
    
  •   cupsdLogMessage(CUPSD_LOG_DEBUG,
                    "Renamed remote printer \"%s\" to \"%s@%s\"...",
                    p->name, p->name, p->hostname);
    cupsdAddEvent(CUPSD_EVENT_PRINTER_DELETED, p, NULL,
    

    @@ -2073,7 +2073,7 @@
    cupsdAddEvent(CUPSD_EVENT_PRINTER_ADDED, p, NULL,
    "Printer '%s' added by directory services.", name);

  •  cupsdLogMessage(CUPSD_LOG_INFO, "Added remote printer \"%s\"...", name);
    
  •  cupsdLogMessage(CUPSD_LOG_DEBUG, "Added remote printer \"%s\"...", name);
    

    /*

    • Force the URI to point to the real server...
      @@ -2334,7 +2334,7 @@

      update = 1;

  •    cupsdLogMessage(CUPSD_LOG_INFO, "Added implicit class \"%s\"...",
    
  •    cupsdLogMessage(CUPSD_LOG_DEBUG, "Added implicit class \"%s\"...",
                name);
    

    cupsdAddEvent(CUPSD_EVENT_PRINTER_ADDED, p, NULL,
    "Implicit class '%s' added by directory services.",

@michaelrsweet michaelrsweet added this to the Stable milestone Mar 17, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment