Skip to content
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

The sleep support sends a SIGKILL to backends leaving printers in an indeterminate state #1905

Closed
michaelrsweet opened this issue Aug 10, 2006 · 2 comments
Milestone

Comments

@michaelrsweet
Copy link
Collaborator

Version: 1.2-current
CUPS.org User: jlovell

The sleep support sends a SIGKILL to backends possibly leaving printers in an indeterminate state. This support should send a SIGTERM instead (e.g. don't force quit print jobs). The attached patch does this.

An enhancement to this would be to give the job a couple of seconds to complete before calling IOAllowPowerChange() (on MacOSX).

Thanks!

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: mike

Fixed in Subversion repository.

@michaelrsweet
Copy link
Collaborator Author

"str1905.patch":

Index: scheduler/sysman.c

--- scheduler/sysman.c (revision 5817)
+++ scheduler/sysman.c (working copy)
@@ -289,7 +289,7 @@

   Sleeping = 1;
  •  cupsdStopAllJobs();
    
  •  cupsdStopAllJobs(0);
    

    cupsdSaveAllJobs();

    for (p = (cupsd_printer_t *)cupsArrayFirst(Printers);

    Index: scheduler/job.c

    --- scheduler/job.c (revision 5817)
    +++ scheduler/job.c (working copy)
    @@ -690,7 +690,7 @@

    cupsdHoldSignals();

  • cupsdStopAllJobs();

  • cupsdStopAllJobs(1);
    cupsdSaveAllJobs();

for (job = (cupsd_job_t *)cupsArrayFirst(Jobs);
@@ -1483,7 +1483,7 @@
*/

void
-cupsdStopAllJobs(void)
+cupsdStopAllJobs(int force) /* I - 1 = Force all filters to stop /
{
cupsd_job_t *job; /
Current job */

@@ -1495,7 +1495,7 @@
job = (cupsd_job_t *)cupsArrayNext(ActiveJobs))
if (job->state_value == IPP_JOB_PROCESSING)
{

  •  cupsdStopJob(job, 1);
    
  •  cupsdStopJob(job, force);
    

    job->state->values[0].integer = IPP_JOB_PENDING;
    job->state_value = IPP_JOB_PENDING;
    }
    Index: scheduler/job.h

    --- scheduler/job.h (revision 5817)
    +++ scheduler/job.h (working copy)
    @@ -115,7 +115,7 @@
    extern void cupsdSaveJob(cupsd_job_t *job);
    extern void cupsdSetJobHoldUntil(cupsd_job_t *job, const char *when);
    extern void cupsdSetJobPriority(cupsd_job_t *job, int priority);
    -extern void cupsdStopAllJobs(void);
    +extern void cupsdStopAllJobs(int force);
    extern void cupsdStopJob(cupsd_job_t *job, int force);
    extern void cupsdUpdateJob(cupsd_job_t *job);

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

No branches or pull requests

1 participant