Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Switch away from using CUPS? 1

Status
Not open for further replies.

motoslide

MIS
Oct 30, 2002
764
US
I'm used to using other UNIX systems for printing, and have no experience with CUPS. My current needs don't require drivers on the UNIX side, as our application will be sending all the codes required.
I need the ability to send jobs to a Windows-shared printer. I've done so on systems which didn't use CUPS, and I'm normally successful. With the CUPS system, I don't even know where to find error messages.
Is there an easy way to remove CUPS and revert back to SYS-V printing?
Forgive me if I'm asking this the wrong way. I just want my old "lp" commands back, and I'd like to know where the configuration files are in case I need to tweak a username/password pair or the IP address of the Windows box.

Thanks in advance...

"Proof that there is intelligent life in Oregon. Well, Life anyway.
 
We use LPRng. It comes with a "print switcher" to let you turn CUPS off (or on) and use it instead. We also dont need printer drivers, we have all the printers set up under LPRng as networked raw printers. We need LPRng for forms control, which doesnt exist under CUPS. Check it out here:
 
I'll check on lprng.
Whatever we use must be supportable (configure, modify, troubleshoot) without having access to the GUI screen. I thought Linux systems could run either CUPS or SVR5 spool utilities. The system I'm working on is running CentOS. I wasn't involved in its early configuration, but will need to support it for the next several years from a remote connection.
I'm working on a SMB-connected printer and need to find the controlling interface file (script) so I can make it dynamically alter the destination Windows system name/IP based upon the user who generates the print job.



"Proof that there is intelligent life in Oregon. Well, Life anyway.
 
It might be simpler to establish a printer alias from the login .bash_profile so that each login has an associated printer.
 
cups can be controlled just fine from the cmd line.

(lpstat, lpadmin, lp, /usr/bin/enable, cancel,...etc)
and you can use "interface" files just like SVRx

generally these are in /etc/cups/interfaces
 
Frustratingly, I have an empty /etc/cups/interfaces directory.
I just removed and re-added the printer (PC) using the "printconf-tui" command. I answer all the questions to configure this printer as an SMB printer. It shows up with the LP commands, but when I send a job to a printer which is shared on my PC, nothing happens. I see this in the /var/log/cups/error_log file:
Code:
I [07/May/2009:15:02:12 -0700] Adding start banner page "none" to job 25.
I [07/May/2009:15:02:12 -0700] Adding end banner page "none" to job 25.
I [07/May/2009:15:02:12 -0700] Job 25 queued on 'PC' by 'root'.
I [07/May/2009:15:02:12 -0700] Started backend /usr/lib64/cups/backend/smb (PID 5347) for job 25.
I tried sending another print job as a "non-root" user. Same result, other than the username in the log file.
I'm able to get a listing of all my shared resources using this command:
smbclient -L 192.168.197.144 -U(username)%(password)

I truly just want to send plain text to this shared printer. I fear CUPS is giving me grief and I definitely don't need to use any of it's print drivers.

"Proof that there is intelligent life in Oregon. Well, Life anyway.
 
One simple way is to install TCP/IP print services on your PC so that it behaves like a Unix LPD server (a standard Windows component which can be installed through Add/Remove Programs) . Then you can configure it in cups using lpadmin -p queuename -v lpd://yourpcname/printername -E.

Annihilannic.
 
The PC part has to be controlled and maintained by non-technical users.
I'll give this a try on my workstation just to see if it behaves better that SMB. If it does, can I modify the entry in /etc/cups/printers.conf to dynamically control the "yourpcname" variable? What I need to accomplish requires that the true destination for that printer is unique for each user, but appears to be the same printer from the Application point-of-view.
Does "printers.conf" get rebuilt everytime a new printer is added (or CUPS restarts)? If so, where is the actual source?

"Proof that there is intelligent life in Oregon. Well, Life anyway.
 
Still beating on this:
I've managed to get the CUPS system to pass print jobs onto my Windows-shared printer using the SMB backend. I'm still struggling with managing the destination dynamically.
The entry in /etc/cups/printers.conf looks like this:
Code:
<Printer PC>
Info Created by redhat-config-printer 0.6.x
Location PDF Creator on local PC
DeviceURI smb://myname:mypassword@MYDOMAIN/MYPCNAME/PDF
State Stopped
StateMessage Unable to connect to CIFS host after (tried 3 times)
Accepting Yes
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
</Printer>
I need to alter the "MYPCNAME" above to be dynamic. For example, when I log onto the system from my PC, I need it to be my PC's name. When "bob" logs in from his PC, it needs to reflect his PC's name. I can set that name as an Environment variable, or drop it into a text file in the users' $HOME directory.
With another system, I get that information and use it for SAMBA like so: (this is part of the printer's interface file)
Code:
#
USERNAME=$2
# clear out the unwanted parameters
shift;shift;shift;shift;shift
# now the argument list is just the files to print

server=`cat /usr/$USERNAME/mypc`
service=PDF
password="-U myname%mypassword"

(
        echo "print -"
        cat $*
) | /bin/smbclient "\\\\$server\\$service" $password -oraw -N > /dev/null
##(

Everytime I think "Linux is OK", something like this comes along and removes the few hairs I have left.

"Proof that there is intelligent life in Oregon. Well, Life anyway.
 
Is your application something you created or a third party app? We have printer names for each user, their login script exports the common application printer name to their unique printer.
 
Our application allows users to select any of a dozen or so printers. In most cases, the printers they use are those closest to them, or loaded with a specific kind of form. What we've recently introduced is a method where they can pick a PDF printer, which presents the output from the *NIX application onto their PC (using a shared PDF printer).

In your case, you have *NIX printers defined for each user? This system may have hundreds of users. It should be easy to have a single *NIX printer defined, and just alter it's destination at print time. My code example above is currently in use on a SCO UNIX system. Since I have access to the printer's interface script, I can set a variable as the job is processed and it finds the correct PC. That's all I want to do. Where are the CUPS interface files? From what I've been able to determine thusfar, the "printers.conf" is the closest thing I've found, and it's only read when CUPS starts, so it's information can't be dynamic. Do you think LPRng would provide a solution?
With CUPS, there is mention of using a DEVICE_URI environment variable. I can't seem to make that work, but it offers promise.

"Proof that there is intelligent life in Oregon. Well, Life anyway.
 
CUPS smb printing is performed by simply passing it through to smbspool, part of the SAMBA suite (not CUPS).

Perhaps that would be your simplest option in this scenario, bypassing CUPS completely? It depends whether your application(s) are hard-coded to use the lp interface/API to print though.

If that is indeed the case, perhaps you can implement your own CUPS backend to replace the standard smb one (in /usr/lib/cups/backend). I'm not sure what additional steps may be involved apart from just creating the script to support the new backend though.

Annihilannic.
 
Thanks for that, Annihilannic. That gave me what I needed. I just created my own script and can pass the output from the Applicaton to that script. This is the part where it sends to the users' local PC:

Code:
 smbspool smb://myname:mypass@MY-DOMAIN/`cat $HOME/myip`/PDF 12345 nobody job_title 1 -
A Star for Annihilanic, and a big "Thank-you" to the others for ideas and timely responses.

"Proof that there is intelligent life in Oregon. Well, Life anyway.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top