LPRng for PXES-0.8 and Citrix Autocreated Client Printers Howto --------------------------------------------------------------- written by Sascha Juch, sj@sepago.de, 2004-08-14 History ------- V 0.1 - first version of this document. As with many documents appearing in a first version there may be some bugs in it - if you find them drop me a line so I can correct them for later releases :) Summary ------- This HOWTO shows, how to add a lpd-daemon to PXES which is capable of creating autocreated client printers for Citrix Metaframe. The setup is split up into three parts (hopefully) allowing to track errors a better way. Installation ------------ I assume you have Red Hat 9 with the same kernel as PXES (2.4.20) and the Citrix ICA-Client installed as a host system. First of all we get rid of cups, because it interfered with the LPRng mechanism - at least on my machine. rpm -qa | grep cups shows what you've got installed from the cups system Let's remove that: rpm -e desktop-printing-0.1.10-6 (as qtcups depends on it) rpm -e qtcups-2.0-15 rpm -e cups-1.1.17-13.3.0.3 now install the newest LPRng (get it from http://www.lprng.org): rpm -Uvi --force LPRng-3.8.27-1.i386.rpm (--force is needed to get the sample /etc/printcap) Now modify the wfclient.ini to tell Citrix which autocreated client printer it should produce. Add (or change) the following lines in the [WFClient]-Section: DefaultPrinter=lp DefaultPrinterDriver=HP LaserJet 4 So if you have another printer than the HP LaserJet 4 connected to your local LPR-Port, replace it with the correct Windows driver name here. Next we need to modify our /etc/printcap Be sure that everything is commented out in the /etc/printcap and add the following lines to it: lp|printer:\ :lp=/dev/lp0:\ :sd=/var/spool/lpd/lp:\ :af=/var/log/lp-acct:\ :lf=/var/log/lp-errs:\ :pl#66:\ :pw#80:\ :pc#150:\ :mx#0:\ :sh: Now restart the lpd daemon with /etc/init.d/lpd restart If it throws up some errors run checkpc -f -V to fix everything automagically and see what was fixed :) Now it's time for a first test: Connect from this host system to the Citrix-Server of your choice. It should automatically generate a printer called Client/#/lp which is your default printer. Click on it's properties and print a test page - it should be printed via the local LPR-port. Congratulations, phase 1 (preparation) is completed ;) If any errors occured check your syslog as well as /var/log/lp-acct and /var/log/lp-errs. Now we need to copy over the LPRng files needed into the PXES-Directory structure to the right directory. By doing a rpm -q -p LPRng-3.8.27-1.i386.rpm you can view which files are relevant for us. Anything except the files under /usr/share/doc and /usr/libexec/. :) Copy all the files (except those mentioned in the line above). Now everything except the dependent libraries is in the PXES-distro. We take care about that now. For each of the executables from the rpm-query do a ldd to see which libraries are needed for them. Copy all the libs evaluated with ldd to the /stock/extra/lpd/lib directory. Next step is to modify the rcS-Startscript of PXES: Search for the section starting with if [ "$LOCAL_LPD_ENABLED" -eq 1 ] then /usr/sbin/lpd else and change it to if [ "$LOCAL_LPD_ENABLED" -eq 1 ] then mkdir /var/spool/lpd chown lp:lp /var/spool/lpd chmod 700 /var/spool/lpd mkdir /var/spool/lpd/lp chown lp:lp /var/spool/lpd/lp chmod 700 /var/spool/lpd/lp /usr/sbin/lpd CPO="-f" if [ "$PXES_DEBUG" -ge 1 ] then CPO="$CPO -V" fi /usr/sbin/checkpc $CPO else That's it for phase 2. Compile PXES with local printer and local lpd enabled. Connect to a Citrix Metaframe Server and watch your local printer automagically appearing under printers. Print a test page and be lucky ;) If your printer shouldn't print check the logs again - we let them in for debugging purposes. If anything went well you now can remove the two logging lines from the /etc/printcap file. So the final /etc/printcap should look like: lp|printer:\ :lp=/dev/lp0:\ :sd=/var/spool/lpd/lp:\ :pl#66:\ :pw#80:\ :pc#150:\ :mx#0:\ :sh: That's it! Have fun, Sascha Juch