Sudev Barar wrote:

> On 8/11/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>> anyway...I found the solution!!!!
>> after moving binaries, directories and libraries (involved software:
>> cups, cups-lpd, a2ps, foomatic-rip, enscript, gs, mpage and perl) from
>> ltsp server to /opt/ltsp/i386... and making some extra-hack to the
>> client-side configuration, everything works!!
>>
>> now, each client is a LPD server listening on port 515 and on its
>> particular queue. i'm soooooo happyyyy :))
>
>
>
> Why not summarize everything for posterity and other who may need such solution?


ok! this post will be pretty long.
I hope to include and remember the whole configuration, which is referred to the path /opt/ltsp/i386 (the LTSP client-side mounted root file system), to a "sample" print queue named "S144", to a "sample" printer model (HP PSC 1310) and to my network: 172.24.13.0/24. of course you can customize your own configuration, for example setting some special rc script which dynamically creates the proper print queue and selects the proper print driver depending on the IP address of the client. in this case you need to make writable the printcap file as well as cups configuration files, by creating symbolic links (ie: ln -s /tmp/printcap etc/printcap).
anyway, in this example such files are all "static" and read-only.


1) I modified etc/rc.sysinit as follows:
1a) uncommenting:
        pr_set 91 "Starting xinetd"
        echo "Starting xinetd"
        xinetd
1b) inserting:
        mkdir /var/spool
        mkdir /var/spool/cups
        mkdir /var/spool/lpd
        mkdir /tmp/certs
        mkdir /tmp/mpage
        mkdir /var/log/cups
        mkdir /var/spool/cups/tmp
        /usr/sbin/cupsd &
    before the line "pr_set 100 ..."

2) I made writable all that needs to be writable:
        ln -s /tmp/mpage usr/tmp
        ln -s /tmp/certs etc/cups/certs

3) I created etc/hosts.allow and added the line:
        cups-lpd: 172.24.13.

4) I created etc/printcap:
        S144|S144:rm=127.0.0.1:rp=S144:

5) I created etc/xinetd.conf:
        {
           instances = 10
           log_type = SYSLOG authpriv
           log_on_success = HOST PID
           log_on_failure = HOST
           cps = 25 30
        }
        includedir /etc/xinetd.d

6) I created etc/xinetd.d and placed the file "cups-lpd" inside of it

7) This is my cups-lpd file:
        service printer
        {
           disable = no
           socket_type = stream
           protocol = tcp
           wait = no
           user = root
           server = /usr/lib/cups/daemon/cups-lpd
           server_args = -o document-format=application/octet-stream
           only_from = 172.24.13.0/24
        }

8) I used "ltsacp" utility from LTSP Contribs to copy the needed libraries from your main root file system to the LTSP root file system:
        ltsacp `which cups`
        ltsacp `which cups-lpd`
        ltsacp `which a2ps`
        ltsacp `which enscript`
        ltsacp `which gs`
        ltsacp `which perl`
        ltsacp `which mpage`
        ltsacp `which lpr`
        ltsacp `which lpq`
        ltsacp `which lprm`
        ltsacp `which lpstat`
        ltsacp `which foomatic-rip`
        ltsacp `which hpijs`

9) I also forced a copy of a more recent version of libc (because this is required by some other library):
        cp /lib/libc.so.6 lib/libc.so.6
        cp /lib/ld-linux.so.2 lib/ld-linux.so.2
        cp /lib/libdl.so.2 /lib/libdl.so.2

10)Unfortunately, you have also to copy more files (not just only the libraries) because cups and some other binary (such as perl, for example) need to refer to their directory hierarchy and/or use other binaries, scripts and so on. So I had to copy these files and directories under the LTSP client-side root FS, setting the destination to the proper parent folder
        /usr/share/cups
        /usr/lib/cups
        /usr/lib/perl5
        /usr/share/a2ps
        /usr/share/enscript
        /usr/share/ghostscript
        /usr/share/mpage
        /etc/enscript.cfg
        /etc/a2ps-site.cfg
        /etc/a2ps.cfg

11)I statically configured cups:
11a)Here's my etc/cups/printers.conf:
        <DefaultPrinter S144>
           DeviceURI usb:/dev/usb/lp0
           Location
           Info
           State Idle
           Accepting Yes
           JobSheets none none
           QuotaPeriod 0
           PageLimit 0
           KLimit 0
        </Printer>
11b)Here's the final rows of my etc/cups/cupsd.conf:
        <Location /printers/S144>
           Order Deny,Allow
           Deny From All
           Allow From 172.24.13.0/24
           AuthType None
        </Location>
11c)WARNING!! Since cups runs as "lp" user, you need to create an entry for it in your etc/passwd file or changing "User" option inside etc/cups/cupsd.conf 11d)SUGGESTION!! If you want to deeply investigate your print server for errors, I suggest you to set "LogLevel" option to the value "debug" inside etc/cups/cupsd.conf. In this way you can see a lot of useful information in the log file "var/log/cups/error_log". For example you can verify if there's some missing component or file which blocks or rejects your print task. 11e)You also need to place the right ppd file in etc/cups/ppd. If we consider this example, there's a file named "S144.ppd" which contains the driver information. It's up to you to decide what printer model you have to use and set the proper ppd file under etc/cups/ppd. This can be done statically or dynamically, depending on your configuration and situation.

12)You can also copy netstat from root FS to LTSP client-side root FS to investigate your network status:
        cp /bin/netstat /opt/ltsp/i386/bin

That's all folks!
Now you just have to try to print, first of all from your client and then from your server by setting a remote LPR/LPD printer (which of course must point to the URI lpd://your_client_IP_ADDR/S144). For example, suppose that your lts.conf file contains the line "SCREEN_02 = shell": you can switch to the console by pressing CTRL+ALT+F2. At the prompt, try first to print using the command "lpr -P S144 /etc/inittab". Since the print driver is set on the LTSP client-side, your remote LPR/LPD printer on the LTSP server can be obviously configured with a "Raw print driver".



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_____________________________________________________________________
Ltsp-discuss mailing list.   To un-subscribe, or change prefs, goto:
     https://lists.sourceforge.net/lists/listinfo/ltsp-discuss
For additional LTSP help,   try #ltsp channel on irc.freenode.net

Reply via email to