This is a start at an faq - random items as they occur It is old and out of date - The last time it was updated was in 2001 and many things have changed. - Ask: in the queue directories of printers with multiple queues (eg. hp654a, hp776 and ath105) there is a script called ask. Makes it easy to query and manipulate multiple queue printers. How to use the spool control "ask" There is **usually** a script called "ask" in the printer spool directories of the machine that drives a printer. It is designed to make controlling the queue easier. One has to be root or in the HDMG group to use it. One can find which machine is driving a printer by looking in any /etc/printcap file - they are all the same or at least should be. For any given print queue there will be an "rm=" parameter which specifies which machine is driving the printer. cd into the spool directory. If there is an ask it can execute all the "lpc" commands for that queue. A bare "ask" is equivalent to an lpq command for that printer. In addition there are the "down" and "up" commands which will turn a queue off or on. Down and up execute two lpc commands "disable" and "stop" or "enable" and "start". In addition "down" allows one to enter a message, which can be several lines, as to the reason the queue is turned off. (Don't forget to enclose the message in quotes (")) One should check to make sure that there are no jobs in the queue before turning it off. If one wants to turn it off with extreme prejudice do an "ask abort" Followed by an ask down. (see the script itself) The disable command prevents other machines from sending jobs to this queue and is very important to prevent people's jobs from piling up in the queue without being printed. The stop command merely prevents the system from printing them from the queue. Let me know if this isn't clear. Jim - Printer Hangs: * The first thing to do is make sure there is an lpd on the machine driving that printer. (See the file: /usr/sunevere/operations/lwp/Bin/lwlist for what should be an up to date list of which machines are driving which printers) If there is no lpd start one. It is usually going to be in /usr/local/sbin/lpd but check the rc startups for sure. It happens, for no known reason, that a printer has a seizure. The symptom is that it looks like it is online and ready but it won't talk to the computer and tests busy. lpreset won't and can't fix it because the problem is with the printer. * cd to the queue. (eg. /usr/spool/hp776 currently on sunkay) * The printers with multiple queues should have an ask script in the spool directory. If so it does lpq/lpc commands for all the queues for that printer (see ask) * run lpc abort (or ask abort) which should kill off all the processes associated with that printer. Sometime it doesn't - grep for lpd to find left over processes. After you have made sure that it/they is/are not for another printer kill it/them. * take the printer off line. * Recyle the power. Rene doesn't like this but it is the only practical way of ensuring the printer will go. * check to make sure someone wasn't charged for a job that didn't print. * put the printer back on line if it's not already there and run lpc enable; lpc start (or ask up). It should go. * If it doesn't - well you're on your own. * To test run /usr/sunevere/cshome/jim/bin4/pp giving it the queue name or you can print /usr/sunevere/cshome/jim/src/pp. It should put the page count in the error file. Apple Color Laserwriter 12/600 PS node name Dickson, queue name cs259b-clr This is an apple printer and as such *will not* communicate with a unix driver. It is it's own PLP node - the best we can do, at least at the moment is to send it jobs, no errors pagecounts or anything else is transmitted back. This means that if anything goes wrong the only known cure is to abort the queue (ask abort) and recycle the power. After repowering it takes a long time to get itself organized. After it prints out two test pages restart the queue (ask up). If there's a job in the queue the lights on the console should start flashing. It takes it a long time to print and if it doesn't there's only a couple of things that can be done. - Try ghostscript - observe any messages. - Try printing it on an HP (B/W) printer. Errors should appear in the queue's errs file. Sun Newsprinter CL+ ink jet, (queue name color776) Never causes a problem. Leave it with the power off but make sure that the "*" is in the console window before shutting it off - it means the ink jets are covered. lasewriters on appletalk The Appletalk network no longer exists but some printers can be accessed via the Apple Chooser via Unix. These printers will appear in the Chooser menu with the suffix "_unix". Some other printers can be accessed directly from a Mac. Those printers *should* appear as the unix queue name with upper case letters (eg. CS123) - Shutting a printer down: * For maintenance or you can't get it to work etc. * run lpc abort; lpc disable; (or ask down "reason for shutdown") * If there are jobs left in the queue send mail to the owners asking what they want to do about it. Most people will simply want the job deleted. - How the spooler works At the moment only the Suns OS 4.1.4 running PLP 3.4 drive most printers. The other machines are running version PLP 4.0.3. There are various reasons for this but the main one is a matter of opening the printer. The drivers simply accept an open stdout from lpd which 3.4 does but 4.0.3 does not. (It's on my todo list) The /etc/printcap file on all (research) machines should be identical. The difference on the machines that drive a printer is another printcap exists in /usr/spool/lpd which overrides the /etc/printcap file. In PLP 3.4 the lpd printcap file completely replaces /etc/printcap and thus all printers must be specified in it. ie. A printer that that machine does not drive must have a printcap entry identicle to that in /etc/printcap. lpd calls the "input filter" (if= entry) which prints the job. It passes a parameter list and pipes the job to it. Stdout is attached to the printer, stderr is attached to the file specified by lf= in the printcap. The banner page is printed by the "output filter" (of= entry). For printers on the ethernet "if" is a shell script which calls a driver which is normally in the lpd directory. For appletalk printers "if" is normally papif in /usr/local/cap. There are other special printers some of which are on serial line. The driver for serial line postscript printers is stlw (source is in /usr/sunkay9/src/printstuff/serialprint). The driver for non-postscript printers is usually ghostscript. Moving a printer. * go to machine to which you want to move the printer and turn off the print queue. (eg. lpc disable hp654a; lpc stop hp654a) At the moment this machine has to be a sun running 4.1.4 unless you're driving a dumb printer with ghostscript. * cd /usr/spool * Replace the printcap entry in /usr/spool/lpd/printcap with an entry appropriate for this printer. Chances are you'll only need to copy the printcap entry from the old machine. If there is no /usr/spool/lpd/printcap (ie. this machine is not already a print driver) start with /etc/printcap. The file name must have a fully qualified domain attached: eg. printcap.sunkay.cs.ualberta.ca * On the from machine look in the input filter script to see where the driver is and copy it over. Likely in lpd. For the appletalk printers it is in /usr/local/cap * machines driving appletalk printers: - the driver is /usr/local/cap/papif but aliased to the queue name. eg. lwcab472 -> papif. - need the appletalk stuff running. See /usr/local/cap/srv.atalk.dapp as an example. Make sure the rc.local file starts it up. - Need the file /etc/cap.printers to translate between unix queue names and appletalk printer names. * tar over the queue directory. This is not the final version but there's a bunch of junk in it which lpd needs. In all likelihood you will now find that the queue is enabled - disable it with lpc so no one can submit a job and screw you up. * try a job (page count is good) - a number of things can go wrong, here are some: - The interface may be configured to accept connections from only some machines. Go to the machine that boots him and edit /tftpboot/hpnp/printername.cfg. You'll have to reboot the printer. - printcap file has the wrong name - fully qualified. - there is no printer_perms file (in lpd) - check to make sure you have the same version of lpd On SunOS 4.1.4 it's currently /usr/local/sbin/lpd. - psof (the banner page) is calling a driver which did does not exist on the "to" machine. This shouldn't happen anymore. - For printers on the ethernet make sure the IP address is not for some other printer. It has happened that the jobs were merrily printing out on another printer. If it's Friday stop here and leave the queue on the new machine disabled. However if it looks like it's going to work: * On the from machine turn off the queue (lpc disable hp654a; lpc stop hp654a) Maybe you should wait for the queue to clear first. * On the from machine edit the printcap (in lpd). Replace the printcap entry for that queue with the one found in /etc/printcap. It should be one which simply routes jobs to another machine. I have taken to concatenating the /etc/printcap file to the end of the /usr/spool/lpd/printcap... file. The first entry that lpd finds is the one it uses so it should be sufficient to just delete the printcap entry that causes it print and leave the one that causes the job to be routed to another machine. Make sure to change the rm= item to point to the new machine. eg. change rm=menaik to rm=dapp * Tar over a fresh copy of the queue directory(s) to the new machine. * lpd start on the new machine and try it. If it prints you ask yourself "how cum I managed to do it right". If everything seems to be working: * on the old machine: - Move the old queue directory aside (in case you have to go back) - create a new one. (~jim/ss.mkspool) - Put in the costcodes pointer if applicable. - Make sure everything in it is owned by daemon. * edit an /etc/printcap to reflect that jobs are to go to the new machine and distribute it. While this is being done jobs will go to the old machine which will reroute them to the new machine. Note: lprm doesn't work through the extra link. * Go to all the machines that drive printers and replace the last part of the /usr/spool/lpd/printcap... with the new /etc/printcap * If the old machine no longer drives any printers you can remove the lpd/printcap. * edit /usr/sunevere/operations/lwp/Bin/lwlist to reflect the changes. * check the cron that runs the file CheckPrinters. This is the guy that checks for stuck printers. Names may have to be adjusted. * check cron that runs movelogs. At the moment there is one on each machine that drives a printer. The list of queue names is hard coded in the movelogs script on each machine. * set yourself a reminder to remove the old stuff in a couple of days. - Where the bodies are buried. * the version of plp (3.4) currently running on 4.1.4 is in /usr/sunkay9/src/printstuff/plp. Executables are in: /usr/local/sbin/lpd /usr/local/bin/lpc /usr/local/bin/lpr - a shell script /usr/local/bin/lpr.real - The real lpr /usr/ucb/lpq - to be moved to local soon /usr/ucb/lprm - to be moved to local soon The reason they are scrambled around like this is historic but as soon as I can switch to PLP403 they will all be in /usr/local/bin * the current versions of the hp drivers (lprps) are in /usr/sunkay9/src/printstuff/lprps. Papif and papof I think are in /usr/sunkay9/src/CAP but check with Bruce - he's been looking after that. The executables are in /usr/local/cap. stlw is in /usr/sunkay9/src/printstuff/serialprint. * the version of PLP running on the other machines is PLP 403 and compressed built versions of them are on st-michael:/usr st-michael:/usr/PLP403 is a generic version which, last I tried, built on HP-UX, IRIX, Solaris, 4.1.4 and Ultrix. It did not on OSF1 and AIX. There is shell script replacement for AIX but I haven't anything in place for OSF1 All executables of PLP403 are in /usr/local/bin - Adding a new printer. Please read the section of "How the spooler works". Adding a printer entails very much the same considerations as "moving a printer". Printers on the net (eg hespero, habay..) need to be booted so they know their IP address. Last I heard sawnlk and menaik boot the printers on subnet 4, kitscoty on 16, gibbons on 23 and sand-rv on 25. See also config files in /tftpboot/hpnp. For the following just follow the lead of entries that are already there. - entry in the ethers (NIS) file (scapa:/etc/ethers). Steve tells me that for bootpd the ethers file is not necessary but I always put it there anyway. - entry in /etc/bootptab on boot server (currently gibbons) - the T144 entry in bootptab specifies a TFTP entry, make sure there is one. - test the printer by sending a page count program directly. ~jim/bin4/pp is quite useful. There is also a script ~jim/test/pr.test/goe which talks to the printer directly. One can also use telnet. Go to the machine that will drive the printer and edit the printcap file in /usr/spool/lpd (If there isn't one you'll have make one - see moving a printer) - create a printcap entry for it. - Create a spool directory for it. One can often just copy a printcap and spool directory from another printer and change the names and IP address. Use tar not cp - tar copies links and preserves ownership. - For printers on the ethernet make sure the IP address is not for some other printer. - Make sure everything is owned by daemon. - Empty the errs and lwacct files. - Turn the queue off (lpc disable/stop name) - The latest ask script and banner.ps file are generic. ie. printer name independent but check them anyway. Caution - they be hard linked to other scripts or files. - update the file /usr/sunevere/operations/lwp/Bin/lwlist This can be done with the script lwlist.make. - update or create /usr/spool/movelogs - this is the guy that rotates the log files. - update /usr/sunevere/operations/bin/CheckPrinters - update cron, if necessary, to run movelogs and CheckPrinters This won't be an appletalk printer because the appletalk network no longer exists but I'm leaving this stuff in here anyway. If this is an appletalk printer you have to: - edit /etc/cap.printers - add printer name in /usr/local/cap. - make sure the appletalk stuff is running Make sure that the appropriate drivers exist in /usr/spool/lpd If this is a brand new printer type, well then you have problems. The following has to be done on the other machines. I use csm -d -e to run the indicated scripts on all the machines. Ususally in my home directory but if not look in st-michael: /usr/jim/PLP403/scripts. Someday I'll put it all together in one. (What's this about hell freezing over?) script ss.printcap - copy a new printcap file to /etc/printcap (if it needs it) - Look for and update lpd printcaps. (/usr/spool/lpd/printcap) - Look for and update samba printcaps. script ss.mkspool - create a spool directory. - make sure it's got a .seq file Make sure to add the new printer name to the list that's in that script. script ss.setcc - If this printer needs charging you have to create a costcode file. * set yourself a reminder to remove the old stuff in a couple of days. - Add contingency plan 0 ie. if sunkay goes down - Straighten out the accounting - Booting renaming a printer. - first create a parallel printer that uses the same spool directory as the the old name. - for a spool directory make a link to the old spool directory - The after you get people using the new name go around and delete the old printer. You will have to move the spool directory to the new name after deleting the link.