Find the answer to your Linux question:
Results 1 to 8 of 8
I have been told that you can setup cups to listen to port 9100 like a working AppSocket (raw) printer. I have been looking for some way to do this ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined! thewonka's Avatar
    Join Date
    Jan 2006
    Location
    What
    Posts
    2

    Cool How to make CUPS a JetDirect/AppSocket print server


    I have been told that you can setup cups to listen to port 9100 like a working AppSocket (raw) printer.

    I have been looking for some way to do this for days now and no luck... i have found 3rd party tools but none have worked for me ( ppf - Printer Port Forwarder for example )

    i wish the printer connected to my routers usb port to print via port 9100 or some other using CUPS.

    if there is a way to configure my linux router (with cups) to share its printer via por 9100 to other computers.

    The client config i can do easy, but the server config is something that i am not sure can be done with just cups.

    for example my routers ip address ( the router that has the printer plugged in to its usb port (/dev/usb/lp0) is 10.0.0.1.

    My client machine is 10.1.0.1, and i wish to use the printer on 10.0.0.1 via por 9100 as i would any jetdirect print server.

    I was told i can configure cups to do so but i have not found any way to do it if its true.

    Is there really a way to do this? or is this just a myth?

    Hope somebody knows,
    Willy

  2. #2
    Just Joined! thewonka's Avatar
    Join Date
    Jan 2006
    Location
    What
    Posts
    2

    Woot

    Figured it out! anybody interested in knowing how, pm me.

    Since theres no info on it out there.. i guess its a secret or something...

  3. #3
    Super Moderator Roxoff's Avatar
    Join Date
    Aug 2005
    Location
    Nottingham, England
    Posts
    3,844
    Dont do this by PM - post it on the thread, it expands everyones knowledge. I had taken a passing interest in this, btw, as it was something that appealed to me technically (my printer is in the loft at the moment, but comes out when we move house, hopefully soon...).
    Linux user #126863 - see http://linuxcounter.net/

  4. #4
    Just Joined!
    Join Date
    May 2006
    Posts
    1
    Assuming CUPS is setup and running...

    Make sure /etc/services has the following line:
    jetdirect 9100/tcp laserjet hplj #


    If you are using xinetd,
    create the file /etc/xinetd.d/jetdirect with the following contents:

    # Allow applications using the AppSocket / JetDirect protocol
    # to communicate with CUPS.
    service jetdirect
    {
    socket_type = stream
    protocol = tcp
    wait = no
    user = lp
    server = /usr/bin/lp
    server_args = -d <CUPS_PRINTER_NAME> -o raw
    groups = yes
    disable = no
    }


    Restart your services:
    service xinetd restart
    service cups restart

    If you are using inetd instead of xinetd,
    edit the file /etc/inetd.conf so it contains the following line:

    9100 stream tcp nowait lp /usr/bin/lp lp -d <CUPS_PRINTER_NAME> -o raw


    Restart your services:
    service inetd restart
    service cups restart


    Your CUPS_PRINTER_NAME can be found in the /etc/cups/printers.conf or /etc/printcap files.


    -Jeff

  5. #5
    Just Joined!
    Join Date
    Apr 2008
    Posts
    1
    Quote Originally Posted by thewonka View Post
    Figured it out! anybody interested in knowing how, pm me.

    Since theres no info on it out there.. i guess its a secret or something...

    Regarding you're original question... you said you figured it out?? So you're miles ahead of me... I'm a linux novice to put it mildly.

    However, I'm searching for some software means of capturing output from a host application that is destined for a HP JETDIRECT attached printer... background of situation: I'd like to take the output from legacy application (unkown host with no current support) and redirect the raw output to a file on a linux box that can subsequently hand it off FTP/LPR/WHATEVER to some other host/application.

    I have physical access to the JETDIRECT BOX and the two printers that are attached (one is an HP laserjet and one is an epson line printer).

    CURRENT SITUATION:

    legacy host application with no ability to change LPR/PORT/IP/ETC port printing settings

    --------------------------------------------|
    LEGACY HOST APP----> JETDIRECT BOX /--- HP Laserjet
    --------------------------------------------\--- EPSON LinePrinter (parallel)

    DESIRED SITUATION:

    no change to legacy host application

    -----------------------------------------------------------------------------------------|
    LEGACY HOST APP ----> LINUX HOST w/ JETDIRECT emulation PORT 9100 capture ---> redirect to file
    -----------------------------------------------------------------------------------------|

    Can CUPS be used to do this? Is CUPS the best tool to do this or are there other progs that are better suited to emulate Jetdirect box/printer. Essentially, because we have no control over the host application we have to fake the host into thinking that it is still talking to the current JETDIRECT Box/printers.

    Any thoughts or comments greatly appreciated...

    cheers,
    kdmackey

  6. #6
    Just Joined!
    Join Date
    Sep 2008
    Posts
    3
    JD

    thanks for the tips. going to try this right away , BUT . .

    in the services file i have an entry on line 9,548:
    hp-pdl-datastr, 9100/udp pdl-datastream

    in order to add the line:
    jetdirect 9100/tcp laserjet hplj #

    should the original line be commented out ?

  7. #7
    Just Joined!
    Join Date
    Sep 2008
    Posts
    3
    I followed the advice from JC, it should work , seems straight forward, but not happening for me yet.

    "nmap -sT localhost" does not show port 9100 as listening

    Tried a "tcpdump port 9100" while sending a print from the remote computer, and get a bunch of information that seems to be irrelevant to port 9100. I could use a bit of help understanding it.

    I must not understand tcpdump, because even though i specified port 9100, i'm getting information that seems to be not for port 9100 at all, but it does all come from the correct computer that i sent my prints from.


    15:32:39.581853 IP 128.1.1.8.tdirect > 192.168.25.233.autodesk-nlm: R 0:0(0) ack 1882637340 win 0
    15:32:39.734768 IP 192.168.25.233.kme-trap-port > 128.1.1.8.tdirect: S 1927031485:1927031485(0) win 24820 <mss 1460>
    15:32:39.734775 IP 128.1.1.8.tdirect > 192.168.25.233.kme-trap-port: R 0:0(0) ack 1927031486 win 0
    15:32:49.895042 IP 192.168.25.233.infowave > 128.1.1.8.tdirect: S 3496895047:3496895047(0) win 24820 <mss 1460>
    15:32:49.895082 IP 128.1.1.8.tdirect > 192.168.25.233.infowave: R 0:0(0) ack 3496895048 win 0
    15:33:00.056810 IP 192.168.25.233.radsec > 128.1.1.8.tdirect: S 190154027:190154027(0) win 24820 <mss 1460>
    15:33:00.056837 IP 128.1.1.8.tdirect > 192.168.25.233.radsec: R 0:0(0) ack 190154028 win 0
    15:33:10.218491 IP 192.168.25.233.sunclustergeo > 128.1.1.8.tdirect: S 2915493815:2915493815(0) win 24820 <mss 1460>
    15:33:10.218517 IP 128.1.1.8.tdirect > 192.168.25.233.sunclustergeo: R 0:0(0) ack 2915493816 win 0
    15:33:20.380207 IP 192.168.25.233.ada-cip > 128.1.1.8.tdirect: S 1604338383:1604338383(0) win 24820 <mss 1460>
    15:33:20.380232 IP 128.1.1.8.tdirect > 192.168.25.233.ada-cip: R 0:0(0) ack 1604338384 win 0

  8. #8
    Just Joined!
    Join Date
    Sep 2008
    Posts
    3
    my mistake

    looking at the info after i posted it, "tdirect" was obviously the local service, so rechecked my "services file and had mispelled jetdirect

    Fixed the typo, restarted xinetd and cups, and voila, working.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •