lpr -r <file> removes file, also if cupsd is not running #886

Closed
michaelrsweet opened this Issue Sep 9, 2004 · 3 comments

Comments

Projects
None yet
1 participant
Collaborator

michaelrsweet commented Sep 9, 2004

Version: 1.1.21rc2
CUPS.org User: js.ub.uni-marburg

My third party software use the command "lpr -r " to print
the files of a "spool directory".
I have the situation that the cupsd dies sometimes (other call).
In this case the file were just deleted.

lpr should look if the daemon is running and willing to spool
the jobs before it deletes the files.

A workaround for me is to wrap lpr with the script:

!/bin/sh

x=/usr/local/bin/lpstat 2>/dev/null
if [ $? = 0 ]
then lpr.org $*
fi

But I think this should be the standard behavior of lpr.

Collaborator

michaelrsweet commented Sep 9, 2004

CUPS.org User: mike

The attached patch contains the fix for this.

Collaborator

michaelrsweet commented Sep 9, 2004

CUPS.org User: mike

Fixed in CVS - the anonymous CVS repository will be updated at midnight EST.

Collaborator

michaelrsweet commented Sep 9, 2004

"str886.patch":

Index: lpr.c

RCS file: /development/cvs/cups/berkeley/lpr.c,v
retrieving revision 1.34
diff -u -r1.34 lpr.c
--- lpr.c 8 Sep 2004 19:01:34 -0000 1.34
+++ lpr.c 9 Sep 2004 14:10:17 -0000
@@ -352,7 +352,7 @@
{
job_id = cupsPrintFiles(printer, num_files, files, title, num_options, options);

  • if (deletefile)
  • if (deletefile && job_id > 0)
    {
    /*
  • Delete print files after printing...

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