cups print to file - but file size is zero

Nitin Kanaskar nitinvk04 at gmail.com
Sat Nov 18 12:22:22 PST 2006


> Nitin Kanaskar wrote:
> > hello all,
> >
> > I am trying to print to a file using cups 1.2.7 on fedora core 4. My kernel is 2.6.11, gcc 4.0.0. I have a default printer named filewriter with DeviceURI = file:/tmp/nitin. When I give command 'lpr filename', a file 'nitin' gets created in /tmp but of size 0. My error log file is as shown below -
> >
> >
> > D [18/Nov/2006:00:42:17 -0600] ReadClient: 6 POST / HTTP/1.1
> > D [18/Nov/2006:00:42:17 -0600] ProcessIPPRequest: 6 status_code=1
> > D [18/Nov/2006:00:42:17 -0600] ReadClient: 6 POST / HTTP/1.1
> > D [18/Nov/2006:00:42:17 -0600] ProcessIPPRequest: 6 status_code=1
> > D [18/Nov/2006:00:42:17 -0600] ReadClient: 6 POST / HTTP/1.1
> > D [18/Nov/2006:00:42:17 -0600] ProcessIPPRequest: 6 status_code=0
> > D [18/Nov/2006:00:42:17 -0600] AcceptClient: 8 from localhost:631.
> > D [18/Nov/2006:00:42:17 -0600] CloseClient: 6
> > D [18/Nov/2006:00:42:17 -0600] ReadClient: 8 POST /printers/filewriter HTTP/1.1
> > D [18/Nov/2006:00:42:18 -0600] print_job: auto-typing file...
> > D [18/Nov/2006:00:42:18 -0600] print_job: request file type is text/plain.
> > D [18/Nov/2006:00:42:18 -0600] check_quotas: requesting-user-name = 'root'
> > D [18/Nov/2006:00:42:18 -0600] print_job: requesting-user-name = 'root'
> > I [18/Nov/2006:00:42:18 -0600] Adding start banner page "none" to job 5.
> > I [18/Nov/2006:00:42:18 -0600] Adding end banner page "none" to job 5.
> > I [18/Nov/2006:00:42:18 -0600] Job 5 queued on 'filewriter' by 'root'.
> > D [18/Nov/2006:00:42:18 -0600] Job 5 hold_until = 0
> > D [18/Nov/2006:00:42:18 -0600] StartJob(5, 0x84cf580)
> > D [18/Nov/2006:00:42:18 -0600] StartJob() id = 5, file = 0/1
> > D [18/Nov/2006:00:42:18 -0600] job-sheets=none,none
> > D [18/Nov/2006:00:42:18 -0600] banner_page = 0
> > D [18/Nov/2006:00:42:18 -0600] StartJob: argv = "filewriter","5","root","anaconda-ks.cfg","1","","/var/spool/cups/d00005-001"
> > D [18/Nov/2006:00:42:18 -0600] StartJob: envp[0]="PATH=/usr/lib/cups/filter:/bin:/usr/bin"
> > D [18/Nov/2006:00:42:18 -0600] StartJob: envp[1]="SOFTWARE=CUPS/1.1"
> > D [18/Nov/2006:00:42:18 -0600] StartJob: envp[2]="USER=root"
> > D [18/Nov/2006:00:42:18 -0600] StartJob: envp[3]="CHARSET=utf-8"
> > D [18/Nov/2006:00:42:18 -0600] StartJob: envp[4]="LANG=en_US"
> > D [18/Nov/2006:00:42:18 -0600] StartJob: envp[5]="PPD=/etc/cups/ppd/filewriter.ppd"
> > D [18/Nov/2006:00:42:18 -0600] StartJob: envp[6]="CUPS_SERVERROOT=/etc/cups"
> > D [18/Nov/2006:00:42:18 -0600] StartJob: envp[7]="RIP_MAX_CACHE=8m"
> > D [18/Nov/2006:00:42:18 -0600] StartJob: envp[8]="TMPDIR=/var/spool/cups/tmp"
> > D [18/Nov/2006:00:42:18 -0600] StartJob: envp[9]="CONTENT_TYPE=text/plain"
> > D [18/Nov/2006:00:42:18 -0600] StartJob: envp[10]="DEVICE_URI=file:/tmp/nitin"
> > D [18/Nov/2006:00:42:18 -0600] StartJob: envp[11]="PRINTER=filewriter"
> > D [18/Nov/2006:00:42:18 -0600] StartJob: envp[12]="CUPS_DATADIR=/usr/share/cups"
> > D [18/Nov/2006:00:42:18 -0600] StartJob: envp[13]="CUPS_FONTPATH=/usr/share/cups/fonts"
> > D [18/Nov/2006:00:42:18 -0600] StartJob: envp[14]="CUPS_SERVER=localhost"
> > D [18/Nov/2006:00:42:18 -0600] StartJob: envp[15]="IPP_PORT=631"
> > D [18/Nov/2006:00:42:18 -0600] StartJob: statusfds = [ 6 9 ]
> > D [18/Nov/2006:00:42:18 -0600] StartJob: filterfds[1] = [ 10 -1 ]
> > D [18/Nov/2006:00:42:18 -0600] StartJob: filter = "/usr/lib/cups/filter/textonly"
> > D [18/Nov/2006:00:42:18 -0600] StartJob: filterfds[0] = [ -1 11 ]
> > D [18/Nov/2006:00:42:18 -0600] start_process("/usr/lib/cups/filter/textonly", 0xbff49780, 0xbff48cf8, 10, 11, 9)
> > I [18/Nov/2006:00:42:19 -0600] Started filter /usr/lib/cups/filter/textonly (PID 15010) for job 5.
> > D [18/Nov/2006:00:42:19 -0600] ProcessIPPRequest: 8 status_code=0
> > D [18/Nov/2006:00:42:19 -0600] CloseClient: 8
> > D [18/Nov/2006:00:42:19 -0600] [Job 5] cat: /var/spool/cups/d00005-001: Permission denied
> > D [18/Nov/2006:00:42:19 -0600] UpdateJob: job 5, file 0 is complete.
> > D [18/Nov/2006:00:42:19 -0600] CancelJob: id = 5
> > D [18/Nov/2006:00:42:19 -0600] StopJob: id = 5, force = 0
> > D [18/Nov/2006:00:42:19 -0600] StopJob: printer state is 3
> >
> >
> > There is no error labeled message in this file, but one message disturbs me - cat: /var/spool/cups/d00005-001: Permission denied. Can anybody throw any light on this?
>
> Your file permissions or SELinux configuration are broken - check
> the /var/log/messages file for SELinux errors, and also check the
> permissions of /var and /var/spool (/var/spool/cups and the d* files
> should have the correct permissions because cupsd assigns them...)
>
> --

hello Michael,

I checked the /var/log/messages - but did not find
any error message there.
Also checked rights of the directories - /var , /var/spool, and
/var/spool/cups. /var & /var/spool are owned by root user, root group.
/var/spool/cups is owned by root user, lp group. Inside the /var/spool/cups directory, there were no d* files, instead c* files.
and a tmp directory. All these files were owned by root user, sys group.
The tmp folder was owned by root user, lp group.
I am trying to understand this - but the program which tries
to access these files is lpr, right? which does not have rights
to access these directories and the files in them.
Is this what is happening, so that I need to change access rights of
these folders and then they would be accessible by this user.
Please clarify if my guess about the user and these directories
is correct.

Thank you so much for your interest in my problem.
Regards,
Nitin


> ______________________________________________________________________
> Michael Sweet, Easy Software Products           mike at easysw dot com
> Internet Printing and Publishing Software        http://www.easysw.com





More information about the cups mailing list