Had a friend send me this little gem that had them perplexed for a while. Eventually they figured it out.
The problem is the command line interface tool "lpq" and "lprm" were throwing the following errors:
user@ubuntu# lpq lpq: lp: cannot chdir to spooling directory user@ubuntu# lprm lprm: lp: cannot chdir to spooling directory
The confusing part is lpr, lpq, lprm and lpstat are all part of the "lpr" Ubuntu package. You can verify your install using "dpkg --get-selections | grep lpr". What we needed was the exact same lpr, lpq, lprm and lpstat binaries which are made to work with CUPSd.
user@ubuntu# sudo apt-get install cups-bsd The following extra packages will be installed: libfile-copy-recursive-perl update-inetd The following packages will be REMOVED: lpr The following NEW packages will be installed: cups-bsd libfile-copy-recursive-perl update-inetd 0 upgraded, 3 newly installed, 1 to remove and 0 not upgraded.
As you can see the old "lpr" package was removed and cups-bsd was installed. cups-bsd replaces the binaries lpr, lpq, lprm and lpstat and works with CUPSd. Now using lpq works as expected with the previously configured cups printers.
user@ubuntu:~# lpq printer is ready no entries
Got a new HP LaserJet 1300. Set it up on the W2k box. Shared it on the network. I needed to print to it from my Linux machines so I setup CUPS (apt-get install cupsys - the best open source printing solution IMHO). The problem I seemed to be having was that I was using SMB printing from the Linux workstation and CUPS needed the device URI for SMB. I was getting the error in the CUPS log "SMB tree connect failed: NT_STATUS_ACCESS_DENIED" with the URI I was using. This is a SAMBA (SMB) error which almost always means permission problems or username password problem. I was not supplying a U and P so I went to find the correct parameters for SMB URI's. After some quick googling I found the correct line for SMB device URI should be: "smb://windowsusername:password@workgroup/workstation/printersharename" (without quotes). Printer fired right up after that.
To get the printing working right I installed the package "gs-esp" (ghostscript esp) on Debian.
Next job was to get OpenOffice.org to print a word doc (Yuck!) to the new laser. Since I use KDE I just used Kprinter. In the KDE menu there is an OpenOffice.org group with a program called "OpenOffice.org Printer Administration" . In there just click "New Printer" then "Add a Printer" selected the laserjet4 (which works great for most laserjets). Then the important part was next. Enter the command for appropriate for this device which for Kprinter is: "kprinter --stdin". The document printed right up after that. Good stuff. I use the same kprinter line to print from xpdf also.