jnork (jnork) wrote,
  • Mood: frustrated

FreeBSD and CUPS: The Saga Continues

OK, I've gone through a bunch of stuff I've done or seen before, and added a couple missing items. The problem lingers.

Basically, CUPS works -- I can print to the printer, but as the wrong printer. (It works but with lower resolution, fewer features, and so on.) I've done this printer before in CUPS under FreeBSD so I know it's doable. Unless something has drastically changed from FreeBSD 5.3 to 6.0 that would cause it to stop working.

One frustrating item was the lack of logging. I figured that out (what, it doesn't install that by default? Tsk) and set the LogLevel to debug (after the log told me to) and I see this:

D [12/Feb/2006:12:36:44 -0800] [Job 20] foomatic-gswrapper: gs '-dBATCH' '-dPARANOIDSAFER' '-dQUIET' '-dNOPAUSE' '-sDEVICE=ijs' '-sIjsServer=hpijs' '-sDeviceManufacturer=HEWLETT-PACKARD' '-sDeviceModel=deskjet 5550' '-dDEVICEWIDTHPOINTS=612' '-dDEVICEHEIGHTPOINTS=792' '-dDuplex=false' '-r300' '-sIjsParams=Quality:Quality=0,Quality:ColorMode=2,Quality:MediaType=0,Quality:PenSet=2' '-dIjsUseOutputFD' '-sOutputFile=/dev/fd/3' '/dev/fd/0' 3>&1 1>&2
D [12/Feb/2006:12:36:44 -0800] [Job 20] **** Unable to open the initial device, quitting.
D [12/Feb/2006:12:36:44 -0800] [Job 20] renderer return value: 1
D [12/Feb/2006:12:36:44 -0800] [Job 20] renderer received signal: 1
D [12/Feb/2006:12:36:44 -0800] [Job 20] tail process done writing data to STDOUT
D [12/Feb/2006:12:36:44 -0800] [Job 20] KID4 exited with status 0
D [12/Feb/2006:12:36:44 -0800] [Job 20] KID4 finished
D [12/Feb/2006:12:36:44 -0800] [Job 20] Process dying with "Possible error on renderer command line or PostScript error. Check options.", exit stat: 3
D [12/Feb/2006:12:36:44 -0800] [Job 20] Possible error on renderer command line or PostScript error. Check options.
D [12/Feb/2006:12:36:44 -0800] [Job 20] KID3 exited with status 3
D [12/Feb/2006:12:36:44 -0800] [Job 20] Renderer exit stat: 3
D [12/Feb/2006:12:36:44 -0800] [Job 20] Renderer process finished
D [12/Feb/2006:12:36:44 -0800] [Job 20] Killing process 43496 (KID3)
D [12/Feb/2006:12:36:44 -0800] [Job 20] Process dying with "Error closing renderer", exit stat: 3
D [12/Feb/2006:12:36:44 -0800] [Job 20] Error closing renderer
E [12/Feb/2006:12:36:44 -0800] PID 43494 stopped with status 3!
D [12/Feb/2006:12:36:44 -0800] UpdateJob: job 20, file 0 is complete.

I then set it back to the more generic, working HP device and got this:

... um, OK, I was looking for the call to foomatic-gswrapper. Fact is, there isn't one, and I suspect that's where the difference lies.

'-sOutputFile=/dev/fd/3' '/dev/fd/0'

Hmm. I figured /dev/fd was the floppy drive, but that would be /dev/fd0, wouldn't it? I found this:

Newer systems provide a directory named /dev/fd whose entries are files named 0,1, 2, and so on. Opening the file /dev/fd/n is equivalent to duplicating descriptor n (assuming that descriptor n is open).


Some systems provide the pathnames /dev/stdin, /dev/stdout, and /dev/stderr. These are equivalent to /dev/fd/0, /dev/fd/1, and /dev/fd/2.

The main use of the /dev/fd files is from the shell. It allows programs that use pathname arguments to handle standard input and standard output in the same manner as other pathnames. For example, the cat(1) program specifically looks for an input filename of - and uses this to mean standard input. The command

filter file2 | cat file1 - file3 | lpr

is an example. First cat reads file1, next its standard input (the output of the filter program on file2), then file3. If /dev/fd is supported, the special handling of - can be removed from cat, and we can enter

filter file2 | cat file1 /dev/fd/0 file3 | lpr

Well, I found this thread. Unfortunately it doesn't tell me anything. The last two questions suggested altering a file that doesn't exist on my system, and looking for the shell setting for a user that doesn't exist on my system. The person who asked the question never responded after that.

Now googling for the key phrase "Unable to open the initial device".

http://www.linuxprinting.org/pipermail/epson-list/2001q4/000893.html probably isn't it.

http://www.ghostscript.com/pipermail/bug-gs/2003-March/002149.html ... well, it looks something like this.Logfile entry:

D [12/Feb/2006:13:56:43 -0800] StartJob: envp[8]="TMPDIR=/var/spool/cups/tmp"


zeus# ls -ld /var/spool/cups/tmp
drwxrwx--T 2 root daemon 1024 Feb 12 13:56 /var/spool/cups/tmp

And that directory contains a bunch of files that look like these:

zeus# ls -l /var/spool/cups/tmp
total 0
-rw------- 1 root daemon 0 Feb 12 12:34 gs_2dwzqb
-rw------- 1 root daemon 0 Feb 12 11:19 gs_4f1sEa

Looks like it's able to write there.

http://www.dbforums.com/printthread.php?t=318605. Not sure how to substitute the full path, but should it need that? hpijs is world executable, and it's in the path, I checked.

http://list.wylug.org.uk/pipermail/wylug-discuss/2004-January/004530.html suggests an invalid model -- which seems possible as the model is 5850, not 5550 as it shows in the log?

D [12/Feb/2006:14:18:29 -0800] [Job 28] foomatic-gswrapper: gs '-dBATCH' '-dPARANOIDSAFER' '-dQUIET' '-dNOPAUSE' '-sDEVICE=ijs' '-sIjsServer=hpijs' '-sDeviceManufacturer=HEWLETT-PACKARD' '-sDeviceModel=deskjet 5850' '-dDEVICEWIDTHPOINTS=612' '-dDEVICEHEIGHTPOINTS=792' '-dDuplex=false' '-r300' '-sIjsParams=Quality:Quality=0,Quality:ColorMode=2,Quality:MediaType=0,Quality:PenSet=2' '-dIjsUseOutputFD' '-sOutputFile=/dev/fd/3' '/dev/fd/0' 3>&1 1>&2
D [12/Feb/2006:14:18:29 -0800] [Job 28] **** Unable to open the initial device, quitting.

Nope, that didn't do it. Heck, chances are the 5850 is a 5550 with extra features (like maybe the wifi or just the jetdirect). But apparently the call to hpijs is also in the .ppd file, so let's do an explicit path.

D [12/Feb/2006:14:23:17 -0800] [Job 29] foomatic-gswrapper: gs '-dBATCH' '-dPARANOIDSAFER' '-dQUIET' '-dNOPAUSE' '-sDEVICE=ijs' '-sIjsServer=/usr/local/bin/hpijs' '-sDeviceManufacturer=HEWLETT-PACKARD' '-sDeviceModel=deskjet 5550' '-dDEVICEWIDTHPOINTS=612' '-dDEVICEHEIGHTPOINTS=792' '-dDuplex=false' '-r300' '-sIjsParams=Quality:Quality=0,Quality:ColorMode=2,Quality:MediaType=0,Quality:PenSet=2' '-dIjsUseOutputFD' '-sOutputFile=/dev/fd/3' '/dev/fd/0' 3>&1 1>&2
D [12/Feb/2006:14:23:17 -0800] [Job 29] **** Unable to open the initial device, quitting.


I'm starting to run out of ideas. Or rather, links to ideas. Or something.

Just for the record, and I believe I've said this before, but it's worth repeating: I've gotten this printer working under CUPS before. And I should add that it's a very simple setup under SuSE. I did it once, and silkensteel was able to do it herself with very little prompting.


Unable to open the initial device, quitting

During initialization, ghostscript opens an output device. Typical output devices include the display, a bitmap output device, a printer output device or the PDF writer output device. This message occurs when the initial output device can not be opened. Some possible reasons are:

  • The output filename is invalid. For example, filename not specified, destination directory doesn't exist, illegal characters in the filename, disk full.

  • Temporary files could not be created. The TEMP environment variable can be used to specify the location for temporary files, and it must point to a directory that exists, is writeable, and has free space. This applies to the pdfwrite device.

So it might be the temp directory and it might be the output device, /dev/fd/3. I'm not quite clear on what /dev/fd/3 is yet, so there's not much I can do with that until I find out. Looks like this is using "TMPDIR" instead of "TEMP" for the temp directory environment variable, but I'm seeing mixed information on which it should be. "TEMP" is not being defined as far as I can tell.

[Previous in thread] [Next in thread]
Tags: cups
  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded