Bug 625955

Summary: Serial back end has inverted SIGTERM block
Product: Red Hat Enterprise Linux 5 Reporter: Bryan Mason <bmason>
Component: cupsAssignee: Tim Waugh <twaugh>
Status: CLOSED ERRATA QA Contact: qe-baseos-daemons
Severity: medium Docs Contact:
Priority: medium    
Version: 5.5CC: azelinka, jpopelka, jscotka, pknirsch, psklenar
Target Milestone: rcKeywords: Patch
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: cups-1.3.7-28.el5 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-02-21 03:09:42 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 668957    
Attachments:
Description Flags
Proposed patch
none
Proposed patch with corrected filename none

Description Bryan Mason 2010-08-20 23:36:21 UTC
Description of problem:

    According to the comments in serial.c:

     /*
      * Now that we are "connected" to the port, ignore SIGTERM so that we
      * can finish out any page data the driver sends (e.g. to eject the
      * current page...  Only ignore SIGTERM if we are printing data from
      * stdin (otherwise you can't cancel raw jobs...)
      */

    However, the code after that comment is:

      if (print_fd != 0)
      {
    #ifdef HAVE_SIGSET /* Use System V signals over POSIX to avoid bugs */
        sigset(SIGTERM, SIG_IGN);
    #elif defined(HAVE_SIGACTION)
        memset(&action, 0, sizeof(action));

        sigemptyset(&action.sa_mask);
        action.sa_handler = SIG_IGN;
        sigaction(SIGTERM, &action, NULL);
    #else
        signal(SIGTERM, SIG_IGN);
    #endif /* HAVE_SIGSET */
      }

Version-Release number of selected component (if applicable):

    cups-1_3_7-18_el5_5_4

How reproducible:

    100%

Steps to Reproduce:

    1. Define a raw print queue with a serial back end.
    2. Submit a print job (lp -d <printer> <file>).
    3. Cancel the print job (cacel <job-id>).
  
Actual results:

    Print job does not cancel

Expected results:

    Print job should cancel.

Additional info:

    See upstream STR #3469.

    Patch is on it's way...

Comment 1 Bryan Mason 2010-08-20 23:50:28 UTC
Created attachment 440069 [details]
Proposed patch

Comment 2 Bryan Mason 2010-08-20 23:58:29 UTC
Oops.  Messed up the STR#.  Sorry.

Comment 3 Bryan Mason 2010-08-21 00:02:00 UTC
Created attachment 440070 [details]
Proposed patch with corrected filename

Comment 6 RHEL Program Management 2011-05-31 14:40:37 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. Red Hat invites you to ask your support
representative to propose this request, if appropriate and relevant,
in the next release of Red Hat Enterprise Linux.

Comment 8 Jiri Popelka 2011-09-14 16:29:53 UTC
I wasn't able to reproduce the problem with cups-1.3.7-26.el5_6.1.
My steps:
# lpadmin -p serialraw -v serial:/dev/ttyS0?baud=115200
# accept serialraw
# lp -d -oraw serialraw cupsd.conf
request id is serialraw-10 (1 file(s))
# lpstat -W not-completed
serialraw-10            root              3072   Wed 14 Sep 2011 06:11:08 PM CEST
# cancel 10
# lpstat -W not-completed
<no job>

Any ideas what have I wrong? This is a virtual machine.

Comment 9 Tim Waugh 2011-09-15 15:08:52 UTC
Do virtual machines have serial ports that always accept data or something like that?

Comment 14 errata-xmlrpc 2012-02-21 03:09:42 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2012-0302.html