% % ../doc/printing/how2print % % The Nemu DAQ system on PC3159, Linux RedHat 7.3 % % Author: Thomas Prokscha, 19-Sep-2001, PSI % % Contents: Description of how to print from the nemu % DAQ account on pc3159 to a shared laser % printer on a NT PC, or to a PSI network printer % using CUPS (Common Unix Printing System). % % Modified: % % $Log: how2print,v $ % Revision 1.3 2003/10/24 09:44:15 nemu % Added network printer WEHA_LEM_1. % % Revision 1.2 2003/02/25 07:49:01 prokscha % Removed old comments. Printing on Lexmark on pc3158 currently disabled. % % Revision 1.1 2003/02/24 15:55:04 nemu % Initial version. % Since Oct-2003: --------------- The network printer WEHA_LEM_1 was installed in Oct-2003 that is used now as default printer on pc3159 and pc4496. Nothing special has to be considered as it was before, see remarks under "Until Jun-2002". WEHA_LEM_1 is a Xerox Phaser 4400 duplex Laser printer located in the LEM counting room. Until Jun-2002: --------------- 1) Printing on shared NT PC (pc3158) ---> On PC3159, this works presently only for the local nemu account. <--- In the .bash_profile script of the nemu account the environment variable DEVICE_URI is defined to send print jobs to a remote NT printer using the smbspool program. To simplify printing of ascii and postscript files the script $HOME/bin/print is available. Login as nemu and enter [nemu@pc3159 nemu]$ print to get online help. Normally, you can enter print paw.ps for postscript files print -c .bash_profile for ASCII files or print -a .bash_profile (the same as print -c) N O T E: The method of print -c(a) is to first convert the ASCII file to a ps file using nenscript. nenscript creates a temporary ps file /tmp/nenscript#####. This file is sent to the shared NT printer using smbspool and deleted after completion. use the print command in Netscape: print -p or you may chosse the long version: smbspool smb://rprint:@PC3158/pc3158/LexmarkO 1 nemu ps 1 o 2) Printing using CUPS: ---> This works for any user. <--- Login as nemu and enter [nemu@pc3159 nemu]$ lpstat -p -d that prints a list of available network printers on the PSI CUPS server and shows you the current default printer. If you want to print your paw.ps file to the printer WEHA_12_1 (printer studio C of WEHA) enter [nemu@pc3159 nemu]$ lp -d WEHA_12_1 paw.ps If a default printer is not defined you can do it by [nemu@pc3159 nemu]$ lpoptions -d WEHA_12_1 # defines WEHA_12_1 as default printer [nemu@pc3159 nemu]$ lp paw.ps # prints to the default printer ------------------------------------------------------------------------------------------------- 3) Detailed information to 1), on how to print from Linux to a shared NT printer using Samba: =========================================================================================== On NT: ------ - install local printer and printer driver on NT PC, for example, a Lexmark Optra R and PS2 laser printer at the parallel port of pc3158. - after sussesful local installation, go via Start-Settings to the printer menu and share the local printer. Now, users logged in on the PSI domain and which have access granted from network at pc3158 may use the local printer as a network printer. - for users not logged on the PSI domain (a Linux user, for example), we have to create a local user account with no password if we want to avoid that users send their PSI domain user name and password each time they want to print on pc3158. create a local user and group for remote access of the printer: -- start the user manager and create, for example, the new group RemotePrint. -- create then a new user, for example, rprint, with empty password field (no password therefore needed when accessing the PC). -- disable local logins for group RemotePrint to prevent local logins to the NT PC by user rprint. -- enable access to computer from network for user rprint. -- to avoid unrestricted access of the new account to any other shared disks change the permissions in the security field of each share to grant n o access to group RemotePrint. Otherwise it would be easy to delete files remotely by user rprint if rprint would login via smbclient. - That's all (I hope...) for the NT machine. On Linux (PSI distribution, based on RH6.2) ------------------------------------------- - Check, if you can access the shares on pc3158 by using the smbclient program: smbclient -L pc3158 -U rprint -W PC3158 (-L host, -U user, -W workgroup or domain name) You should get something like added interface ip=129.129.84.159 bcast=129.129.255.255 nmask=255.255.0.0 Password: Enter Return for the password and you should get: Domain=[PSI] OS=[Windows NT 4.0] Server=[NT LAN Manager 4.0] Sharename Type Comment --------- ---- ------- C Disk BackupShare ADMIN$ Disk Remote Admin IPC$ IPC Remote IPC C$ Disk Default share LexmarkR Printer Lexmark Optra R LexmarkO Printer Lexmark Optra PS2 print$ Disk Printer Drivers Server Comment --------- ------- Workgroup Master --------- ------- - Define the environmental variable DEVICE_URI which is used by the smbspool program to get the information where to send the print job. In the .bash_profile file add en entry like export DEVICE_URI="smb://rprint:@PC3158/pc3158/LexmarkO" N O T E: printing does not work if you choose the LexmarkR service (on PC2870 it worked. Don't know why it fails now...) which has the general format smb://[username:password@][workgroup/]server/printer - Test printing using a postscript file (print, for example, from netscape to a file, automatically creating netscape.ps): smbspool Job-ID user title copies option [file] The parameters up to [file] are not very important; in our example we could print the netscape.ps file by entering smbspool 1 nemu ps 1 o netscape.ps - to print ASCII files they must first transformed to postscript using the nenscript program. For example, you want to print your .bash_profile file. Then, enter nenscript -2G -M A4 -r -p tmpfile .bash_profile smbspool 1 nemu ps 1 o tmpfile nenscript --help gives online help on options. In the example above we have -2 two columns per page -G print header containing date and file name -M A4 print media is A4 instead of letter (default) -r landscape instead of portrait -p tmpfile write output to tmpfile instead of sending it to the printer - to make printing more easy I installed the print script on pc3159 for use with the nemu account only. It is located in $HOME/bin of the nemu account. When you are logged in as user nemu on pc3159 start a terminal and enter print to get online help. You should use print -c .bash_profile to print ASCII files, and you can use print netscape.ps for postscript files.