home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume25 / ispin / part15 < prev    next >
Encoding:
Text File  |  1992-02-01  |  13.7 KB  |  318 lines

  1. Newsgroups: comp.sources.unix
  2. From: sir-alan!ispin!lbartz@iuvax.cs.indiana.edu (Larry Bartz)
  3. Subject: v25i126: Indianapolis Standard Printer Interface for Networked printers, Part15/15
  4. Sender: sources-moderator@pa.dec.com
  5. Approved: vixie@pa.dec.com
  6.  
  7. Submitted-By: sir-alan!ispin!lbartz@iuvax.cs.indiana.edu (Larry Bartz)
  8. Posting-Number: Volume 25, Issue 126
  9. Archive-Name: ispin/part15
  10.  
  11. #! /bin/sh
  12. # This is a shell archive.  Remove anything before this line, then unpack
  13. # it by saving it into a file and typing "sh file".  To overwrite existing
  14. # files, type "sh file -c".  You can also feed this as standard input via
  15. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  16. # will see the following message at the end:
  17. #        "End of archive 15 (of 15)."
  18. # Contents:  ISPIN/misc/PC-LANtoISPIN/README
  19. #   ISPIN/misc/PC-LANtoISPIN/lpr~lpd_ISPIN
  20. # Wrapped by socrates@indy6 on Tue Jan 28 15:27:23 1992
  21. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  22. if test -f 'ISPIN/misc/PC-LANtoISPIN/README' -a "${1}" != "-c" ; then 
  23.   echo shar: Will not clobber existing file \"'ISPIN/misc/PC-LANtoISPIN/README'\"
  24. else
  25. echo shar: Extracting \"'ISPIN/misc/PC-LANtoISPIN/README'\" \(7134 characters\)
  26. sed "s/^X//" >'ISPIN/misc/PC-LANtoISPIN/README' <<'END_OF_FILE'
  27. X11/21/91
  28. X
  29. XAll the articles in the various PC and networking magazines on the topic
  30. Xof "Network Printing" are enough to make me gag myself with a printer ribbon.
  31. X
  32. XThey aren't talking about networked printers at all! They're talking hard-
  33. Xwired printers on networked systems. That's baby stuff.
  34. X
  35. XWith ISPIN, we have printers ON THE NETWORK. If you're this deep into the
  36. Xapplication, you already know how we do it.
  37. X
  38. XThis document outlines our recent (like last week) successful efforts to
  39. Xissue print jobs from MS-DOS PC clients of a Novell server to a UNIX box
  40. Xon the same LAN which (among other things) is acting as an ISPIN server.
  41. X
  42. XWe've been doing network printing from UNIX boxes, through X.25 apads and
  43. Xlocal switches, to printers for about three years. A 10BASE-T ethernet,
  44. XNovell server, and MS-DOS client PCs were recently introduced to our local
  45. Xenvironment.
  46. X
  47. XRight away, the Novellers (ex MS-DOSers) started talking about how expensive
  48. Xand difficult it is to do network printing. The PC and network mags said
  49. Xpretty much the same.
  50. X
  51. XHey, bud. I got yer network printing right here.
  52. X
  53. XAs with all things UNIX, there are/will be many possible ways to do this 
  54. X(see OTHER WAYS TO SKIN THE CAT).
  55. X
  56. XHere's our setup:
  57. X
  58. X               Hardware:
  59. X                         * X.25 network with asynchronous pads
  60. X                           - all of our printers, dumb ascii terminals,
  61. X                             and UNIX cpu serial i/o ttys are connected
  62. X                           - provides RS-232C serial i/o connectivity
  63. X                           - we use it for both local and wide area
  64. X                             (nationwide) connectivity
  65. X                           - on a smaller or local scale, a "smart switch"
  66. X                             or stat mux (like Tellabs, Equinox, Mitron,
  67. X                             David, etc) can do the same thing
  68. X
  69. X                         * 10BASE-T Ethernet, cards, transceivers, concentrator
  70. X                           - connects MS-DOS PCs, Novell server, UNIX box
  71. X
  72. X               Software:
  73. X                         * UNIX
  74. X                           - of course
  75. X                           - some particular features of this UNIX:
  76. X                             * support Sys V lp/lpsched - for ISPIN
  77. X                             * support TCP/IP - for LAN communications
  78. X                             * support BSD lpr/lpd
  79. X                             * In our case, it's a Sequent, running a
  80. X                               dual universe ucb/att environment. Pyramid
  81. X                               does this too. Others?
  82. X                             * see "OTHER WAYS..."
  83. X
  84. X                         * ISPIN - to run on the UNIX box
  85. X
  86. X                         * packet driver software - This is a software
  87. X                           frontend for the ethernet card on the MS-DOS
  88. X                           PC. Our Cabletron cards came with a very effective
  89. X                           packet driver. If yours didn't, the Clarkson
  90. X                           drivers would fit here. The packet driver allows
  91. X                           the PC to talk to the UNIX box via TCP/IP while
  92. X                           also allowing the PC to talk IPX/SPX to Novell.
  93. X
  94. X                         * lpr client software for the PC - We're using
  95. X                           an application called "LPR, LPQ, LPRM Network
  96. X                           Printing Utilities (for MS-DOS Computers)" by
  97. X                           Paul Hilchey, University of British Colombia. We
  98. X                           got it as part of Clarkson University's CUTCP
  99. X                           suite.
  100. X
  101. XHOW WE DID IT
  102. X
  103. XISPIN on the Sequent has been cranking for years. The PC/Novell/Ethernet thing
  104. Xwas set up recently. Then we:
  105. X    
  106. X                     1. Hooked up the Sequent to the Ethernet and did the
  107. X                        necessary BSD networking configuration stuff.
  108. X
  109. X                     2. Cranked up the Sequent's lpd subsystem. We had 
  110. X                        previously used only the Sys V side's lp/lpsched.
  111. X
  112. X                     3. Configured lpr queue members which pass their work
  113. X                        to corresponding Sys V lp queue members. See the file 
  114. X                        "lpr~lpd_ISPIN", a document by John Withers (IRS, 
  115. X                        Springfield District Office) which describes this 
  116. X                        procedure.
  117. X
  118. X                     4. Installed the client LPR software on the PC(s).
  119. X                        Some config work here - not bad - good documentation.
  120. X                        We'll probably put the executable on the Novell 
  121. X                        server so the diskless people can use it too.
  122. X    
  123. X                     5. Started printing. The PC users who are on the LAN 
  124. X                        can print anything which resides on their own box
  125. X                        or on the Novell to any networked printer on the
  126. X                        X.25.
  127. X
  128. X                        LAN users, LAN files, WAN printing.
  129. X
  130. XHOW IT WORKS 
  131. X
  132. X                     1. The BSD lpd is a network server daemon and a
  133. X                        local print request server daemon. On the network
  134. X                        side, it's waiting for print requests and data
  135. X                        to come in over the LAN.
  136. X
  137. X                     2. The lpr client program on the PC establishes a
  138. X                        TCP/IP connection with the UNIX's lpd, then sends
  139. X                        the request and the data.
  140. X
  141. X                     3. John's lpr/lpd-to-lp/lpsched interface hands off 
  142. X                        the job to the Sys V scheduler, which ultimately
  143. X                        calls ISPIN.
  144. X                        
  145. X
  146. XOTHER WAYS TO SKIN THE CAT
  147. X
  148. X  There are just a few components of this scenario which are absolutely
  149. X  required to make it work.
  150. X
  151. X  REQUIREMENTS:
  152. X                     1. UNIX
  153. X                     2. Sys V lp/lpsched subsystem
  154. X                        - ISPIN doesn't do BSD lpr/lpd - yet
  155. X                     3. ISPIN
  156. X
  157. X  ALTERNATIVES:
  158. X                     1. As previously mentioned, if you don't have X.25
  159. X                        apads for cpu to printer virtual connections,
  160. X                        smart switches or stat muxes will work. ISPIN
  161. X                        is so flexible you could even do it with dialup
  162. X                        modems (feasible, but not recommended).
  163. X
  164. X                     2. The only reason we have the BSD lpr/lpd subsystem
  165. X                        involved is because it supports the networked
  166. X                        client/server model and the software is available.
  167. X
  168. X                        If you don't have a dual universe UNIX (ucb/att),
  169. X                        finding both lp/lpsched and lpr/lpd on the same
  170. X                        system would be rare.
  171. X
  172. X                        A network client/server pair could be cooked-up
  173. X                        to support Sys V lp/lpsched directly, thus avoiding
  174. X                        the extra step of passing through BSD lpr/lpd.
  175. X                        I haven't seen a UNIX System V Release 4 box yet,
  176. X                        but I have heard that this is a supported feature.
  177. X
  178. XMore later,
  179. XLSB
  180. END_OF_FILE
  181. if test 7134 -ne `wc -c <'ISPIN/misc/PC-LANtoISPIN/README'`; then
  182.     echo shar: \"'ISPIN/misc/PC-LANtoISPIN/README'\" unpacked with wrong size!
  183. fi
  184. # end of 'ISPIN/misc/PC-LANtoISPIN/README'
  185. fi
  186. if test -f 'ISPIN/misc/PC-LANtoISPIN/lpr~lpd_ISPIN' -a "${1}" != "-c" ; then 
  187.   echo shar: Will not clobber existing file \"'ISPIN/misc/PC-LANtoISPIN/lpr~lpd_ISPIN'\"
  188. else
  189. echo shar: Extracting \"'ISPIN/misc/PC-LANtoISPIN/lpr~lpd_ISPIN'\" \(4195 characters\)
  190. sed "s/^X//" >'ISPIN/misc/PC-LANtoISPIN/lpr~lpd_ISPIN' <<'END_OF_FILE'
  191. XTHIS PROCEDURE WAS DEVELOPED & DOCUMENTED BY JOHN WITHERS, SYSTEMS ADMINISTRATOR
  192. XAT INTERNAL REVENUE SERVICE, SPRINGFIELD DISTRICT OFFICE
  193. X
  194. XDate: Thu Jan 10 08:51 CST 1991
  195. XFrom: pharaoh!withers (withers)
  196. XMessage-Id: <101240010132614EMU0000@pharaoh>
  197. XTo: lbartz@ispin
  198. XSubject: Revised 'How To' document!
  199. X
  200. XThis reflects my 'reflections' and our discussion:
  201. X
  202. XUsing ISPIN in the UCB universe (Pyramid, Sequent, et. al)
  203. X(Requires no modification to ISPIN)
  204. X
  205. XThis 'hack' evolved from our use of the UCB line printer spooler (lpr/lpd)
  206. Xon our Pyramid MIServer4/1 instead of the ATT line printer spooler
  207. X(lp/lpsched).  We had implemented lpr/lpd in all of our applications and
  208. Xdidn't really want to change just to run ISPIN.
  209. X
  210. XGeneral procedure.
  211. X
  212. XIn the ATT universe:
  213. X
  214. X1) Compile and install ISPIN.
  215. X2) Configure the ATT line printer spooler for network printers as
  216. X   described in the ISPIN documentation.  TEST ISPIN directly from
  217. X   the ATT universe to make sure your rtab entries are good. (This
  218. X   one bit me BIG-TIME!)
  219. X
  220. X    Just one word of warning.  NEVER EVER define the same 
  221. X    serial port as output for both lpsched and lpd.  Why?  
  222. X    LPSCHED opens his output devices and holds them open 
  223. X    (non-exclusive) set as it thinks appropriate. LPD 
  224. X    opens the device each time it wants to print to it and 
  225. X    assumes that it is in some sort of 'virgin' state before 
  226. X    it sets it up.  The net result is that LPD output to the 
  227. X    shared device is garbled and un readable.  I did this
  228. X    when I was testing my basic configuration of 'lpsched' 
  229. X    when ISPIN didn't work the way I expected and it took
  230. X    a lot of head scratching to figure out what happened.
  231. X
  232. XIn the UCB universe:
  233. X
  234. X1) In a convenient directory (I used /usr/local/lib/filters) create
  235. X   a shell script like the following (I called it FILTER):
  236. X
  237. X#!/bin/att /bin/sh
  238. X#
  239. X#  This shell script acts as a 'universe bridge' to collect information
  240. X#  from the UCB/LPR print spooler and pass it the ATT/LP print spooler
  241. X#  so it can be processed by ISPIN (Thanks Larry)
  242. X#
  243. X
  244. XQUE=`basename $0`
  245. XNOW=`date "+%T %D"`
  246. Xecho "$NOW - Printer $QUE requested" >> /usr/local/lib/filters/filter.log
  247. Xexec lp -d$QUE -
  248. X
  249. X2) Link this file (FILTER) to a file with the same name as the ISPIN
  250. X   controlled Queue under control of lpsched. (IMPORTANT!)
  251. X
  252. X   For example, if you created a queue called 'spr_iss', use the
  253. X   command 'ln FILTER spr_iss' to create the filter for the lpd.
  254. X
  255. X3) Edit /etc/printcap to define the new print spool for lpd.
  256. X   This is how I did it for the que 'spr_iss' mentioned above:
  257. X
  258. X#
  259. X#  Definition of remote printers via the 'bridge' filter to ISPIN
  260. X#
  261. Xspr_iss|ISS printer #1 (Shared Centronics):\
  262. X    :tr=\f:lf=/usr/adm/lpd-errs:pl=66:pw=255:\
  263. X    :of=/usr/local/lib/filters/spr_iss:\
  264. X    :sd=/usr/spool/lpd/remote:\
  265. X    :lo=remoteLOCK:\
  266. X    :lp=/dev/null:
  267. X
  268. X   Notes: a) I used the same sd (spool directory) for all of the ISPIN queues.
  269. X         This simplifies life a lot, otherwise you would have to have
  270. X         a directory for each queue on both the UCB and ATT sides.
  271. X         Besides, as far as I can tell, files 'cross the bridge' very
  272. X         rapidly and the chances of them stacking up on the UCB side
  273. X         is quite slim, if everything is working. (RECOMENDATION)
  274. X/* editorial comment:
  275. X                      I disagree with John on this. I believe each queue
  276. X                      member should have its own spool directory. This 
  277. X                      would prevent confusion of sequence numbers, data
  278. X                      files, and control files.
  279. X
  280. X                      LSB
  281. X*/
  282. X      b) I used the same lo (lock file) for all the ISPIN queues.  
  283. X         This controls the number of files which can cross at the same
  284. X         time.  It should be fast enough, one a time. (RECOMENDATION)
  285. X      c) Set of (output filter) to the full path of the script you created
  286. X         in step two (2) above. (REQUIRED)
  287. X      d) The lp (line printer) entry should always point to /dev/null.
  288. X         For a more complete explanation, see the ISPIN documentation,
  289. X         the reasoning is the same. (REQUIRED)
  290. X      e) I kept the queue names the same on both sides of the bridge, but
  291. X         you don't need to.  The only requirement is that the output
  292. X         filter name be the same as the ATT queue name. (RECOMENDATION)
  293. X
  294. END_OF_FILE
  295. if test 4195 -ne `wc -c <'ISPIN/misc/PC-LANtoISPIN/lpr~lpd_ISPIN'`; then
  296.     echo shar: \"'ISPIN/misc/PC-LANtoISPIN/lpr~lpd_ISPIN'\" unpacked with wrong size!
  297. fi
  298. # end of 'ISPIN/misc/PC-LANtoISPIN/lpr~lpd_ISPIN'
  299. fi
  300. echo shar: End of archive 15 \(of 15\).
  301. cp /dev/null ark15isdone
  302. MISSING=""
  303. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ; do
  304.     if test ! -f ark${I}isdone ; then
  305.     MISSING="${MISSING} ${I}"
  306.     fi
  307. done
  308. if test "${MISSING}" = "" ; then
  309.     echo You have unpacked all 15 archives.
  310.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  311. else
  312.     echo You still need to unpack the following archives:
  313.     echo "        " ${MISSING}
  314. fi
  315. ##  End of shell archive.
  316. exit 0
  317.  
  318.