Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic
Pages: (6) </ 1 [2] 3 4 5 6 >/

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: cups-1.3.5, /var and epsgs< Next Oldest | Next Newest >
Juanito Offline





Group: Members
Posts: 1601
Joined: Sep. 2005
Posted: Feb. 18 2008,10:22 QUOTE

So... I compiled hplip-2.8.2 separately from cups-1.3.5 - the only thing hplip does as far as cups is concerned is add two backends, hp & hpfax.

Once these have been added however, the cups browser interface automatically detects the printer (uri=hp:/usb/OfficeJet_K80?serial=ES0911401VOH) and the cups test page prints without problems - using the copies of gs, foomatic-rip and hpijs I compiled with cups...

I'm kind of at a loss to understand why the usb backend will not print to a usb printer when the hp backend will print to a usb printer - hplip requires usb headers/libs to compile whereas cups doesn't, but then the cups usb backend manages to query the printer correctly anyway...
Back to top
Profile PM 
Juanito Offline





Group: Members
Posts: 1601
Joined: Sep. 2005
Posted: Feb. 23 2008,11:33 QUOTE

OK, so leaving aside the issue of why I cannot print via the usb backend to a usb port, I'd like to make the cups extension a little more user friendly than the one inside the hplip extension...

The idea would be that a script(s) in the extension would:

1. Create the various directories required in /var (unless they already exist)
2. Copy the various .conf files required to /etc (unless they already exist)
3. Prompt the user to enter a root password (unless it is already set)
4. Start the cups scheduler (unless it is already running)
5. Start firefox & load the cups browser interface http://localhost:631 (unless it is already open)

Writing the script(s) is one issue, but probably the bigger issue is if it is OK, dsl-wise, to have a uci extension creating a bunch of folders/files that will not be removed when it is unloaded. I've tried to think of another way to do this - does anybody have a better idea?

Is there a script that would automatically run when a uci is loaded, or would I have to run the above script(s) from an icon/menu item?
Back to top
Profile PM 
^thehatsrule^ Offline





Group: Members
Posts: 3275
Joined: July 2006
Posted: Feb. 23 2008,18:54 QUOTE

There is (currently) no "autorun" feature.  It would be best to have the scripts to be manually invoked, and perhaps have the option of executing a script that will uninstall those files and then unload the extension.
Back to top
Profile PM 
Juanito Offline





Group: Members
Posts: 1601
Joined: Sep. 2005
Posted: Mar. 30 2008,10:13 QUOTE

OK, so I finally got cups-1.3.5 to print after I realised my OfficeJetG85/OfficeJetK80 would need hpoj as well as hpijs. Now I can print from a 2.4MB extension (cups+hpijs+hpoj+foomatic) as opposed to a 20MB extension (cups+hplip+libusb+foomatic+epsgs, plus python, plus...).

In case anybody is interested, the trick is:
Code Sample
$ sudo /opt/cups-1.3.5/sbin/ptal-init setup
Probe for USB-connected devices ([y]/n)?  

Probing "/dev/usb/lp0"...  
   Found "OfficeJet G85"
   with serial number "SGG13E0C49VL".
Starting the HP OfficeJet Linux driver.
   mlc:usb:OfficeJet_G85

$ sudo /opt/cups-1.3.5/lib/cups/backend/ptal      
direct ptal:/mlc:usb:OfficeJet_G85 "Hewlett-Packard OfficeJet G85" "PTAL mlc:usb:OfficeJet_G85"

...and now on restarting cups admin, the printer is found automatically

Device URI: ptal:/mlc:usb:OfficeJet_G85.

I've started to set up an extension named cups-1.3.5.uci with a menu item/icon that calls a script that creates the folders cups requires (or else it will not work) in /var.

The next thing I would like the script to do is:

IF /etc/cups does not exist
THEN create /etc/cups and copy cupsd.conf to it
ELSE IF /etc/cups/cupsd.conf does not exist
THEN copy cupsd.conf to /etc/cups

and

IF cupsd is not running
THEN start cupsd [maybe it should be restarted anyway?]

I be grateful if somebody could spare me several hours of messing around with bash, trying to figure out how to do this  :)
Back to top
Profile PM 
curaga Offline





Group: Members
Posts: 2163
Joined: Feb. 2007
Posted: Mar. 30 2008,11:15 QUOTE

the "exists" test is -e.. So

IF /etc/cups does not exist
would be
if [ ! -e /etc/cups ]; then

And cupsd not running:
if ! ps | grep cupsd; then


--------------
There's no such thing as life. Those mean little jocks invented it ;)
-
Windows is not a virus. A virus does something!
Back to top
Profile PM 
29 replies since Feb. 10 2008,10:11 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

Pages: (6) </ 1 [2] 3 4 5 6 >/
reply to topic new topic new poll
Quick Reply: cups-1.3.5

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code