LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-18-2007, 01:38 PM   #1
lefty.crupps
Member
 
Registered: Apr 2005
Location: Minneap USA
Distribution: Debian, Mepis, Sidux
Posts: 470

Rep: Reputation: 32
[Solved] CUPS: how do i install a serial printer via cli 'lpadmin' ?


RedHat (actually, CentOS 4.4)

I need to have a way to install a serial printer (I think!) via the command line, using the lpadmin tool or any other program that can be run in a script.

I say 'I think!' because my client seems to want this to be a serial printer but he keeps discussing having the printer's URI be a file /var/isd/SER-A07/printdata

Whatever -- when he sets up the printer using the printconf-tui tool, these are the steps that he takes:
Quote:
For the non-interactive option, I only need to pass one parameter which would be a sitename (i.e. SER-A07). Using printconf, the equivalent options would be:

Add
Queue Name = SER-A07
LOCAL printer
Custom
Device File = /var/isd/SER-A07/printdata
Text Only printer
Finish
When following these instructions, I get the following entry in the /etc/cups/printers.conf file:
Code:
<Printer SER-A07>
Info Created by redhat-config-printer 0.6.x
DeviceURI file:/var/isd/SER-A07/printdata
State Idle
Accepting Yes
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
</Printer>
We want the same entry to appear in printers.conf as above, but done with a non-interactive command or script. Currently when I try to do this I get:

Code:
[root@linux ~]# lpadmin -p serial_test -v file:/var/isd/SER-A07/printdata -E
lpadmin: add-printer (set device) failed: client-error-not-possible
[root@linux ~]#
What am I doing wrong from the command line? Do I need to specify the interface ('-i' flag) somehow, and if so what the heck is that?? (I've not found any real info on that, anywhere). Do I need to specify a PPD file, and if so, what would that be for a text-only printer? Notice when doing it via printconf-tui there is never a question about the printer model, because its text; I don't think the PPD is used.

Anyone familiar with CUPS and lpadmin and can help me? I tried a few times in #rhel and #cups and #centos on IRC but no one knows.

Last edited by lefty.crupps; 08-02-2007 at 12:16 PM.
 
Old 08-02-2007, 11:55 AM   #2
lefty.crupps
Member
 
Registered: Apr 2005
Location: Minneap USA
Distribution: Debian, Mepis, Sidux
Posts: 470

Original Poster
Rep: Reputation: 32
an update, but not yet solved...

running the command:
Code:
lpadmin -p serial_test -v file:/var/isd/SER-A07/printdata -E
gives the same error as above; if I change that command to read:
Code:
lpadmin -p serial_test -v serial:/var/isd/SER-A07/printdata -E
it adds in my printer just fine. It seems to be the -v flag doesn't like any sort of 'file' that I give it, always returning the above error and changing the entry in /etc/cups/printers.conf to be
Code:
DeviceURI file:/dev/null
and that is wrong...
 
Old 08-02-2007, 12:15 PM   #3
lefty.crupps
Member
 
Registered: Apr 2005
Location: Minneap USA
Distribution: Debian, Mepis, Sidux
Posts: 470

Original Poster
Rep: Reputation: 32
Talking SUCCESS! FileDevice line in /etc/cups/cupsd.conf

In the file [/etc/cups/cupsd.conf] I had to change this line from
Code:
#FileDevice No
to match the following:
Code:
#
# FileDevice: determines whether the scheduler will allow new printers
# to be added using device URIs of the form "file:/foo/bar". The default
# is not to allow file devices due to the potential security vulnerability
# and due to the fact that file devices do not support raw printing.
#
FileDevice Yes
#
and it worked! Notice no errors:
Code:
[root@linux ~]# lpadmin -p success -v /var/isd/SER-A07/printdata -E
[root@linux ~]#
BUT it does NOT show up when I run:
Code:
printconf-tui


BUT the lines in /etc/cups/printers.conf are correct:
Code:
[root@linux ~]# cat /etc/cups/printers.conf
# Printer configuration file for CUPS v1.1.22rc1
# Written by cupsd on Thu 02 Aug 2007 10:07:46 AM PDT
<DefaultPrinter success>
Info Created by redhat-config-printer 0.6.x
DeviceURI file:/var/isd/SER-A07/printdata
State Idle
Accepting Yes
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
</Printer>
[root@linux ~]#
I still am fighting to get it to be a Text-Only printer; giving either of the following flags:
Code:
lpadmin -p success -v /var/isd/SER-A07/printdata -P /usr/share/cups/model/textonly.ppd -E
lpadmin -p success -v /var/isd/SER-A07/printdata -m textonly.ppd -E
both add the printer without error or warning, but when viewed in printconf-tui the driver is listed as Raw...

I hope that this helps someone in the future, thanks for reading.

Last edited by lefty.crupps; 08-13-2007 at 02:31 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cannot add a printer with the lpadmin command (client-error-not-possible) rocordial Linux - Hardware 2 03-22-2005 02:20 AM
CUPS, Fedora, and Serial printer (Apple) StevePoling Linux - Hardware 1 02-18-2005 08:32 PM
raw queue with usb printer (-v option in lpadmin command) rocordial Linux - Hardware 4 02-10-2005 11:36 AM
How do I install and config a printer from the CLI? walterbyrd Debian 5 05-07-2004 06:26 PM
Network printer and lpadmin mattyjizm Linux - Networking 1 05-07-2004 12:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:04 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration