Axel Neumann
2000-Jun-05 15:10 UTC
SAMBA digest 2547 / problem with print command file name substitution
Peter A Bryant wrote:>We have recently upgraded from Samba 1.9.16 to Samba 2.0.06, >for serving files and printers to our NT4 clients.>Since the upgrade, printers that were working are no longer printing.>Most of the printers work fine, but printers that have a "print command" >in the printer share are not printing, only spooling the file.>The print command works ok when typed into the command line. >I have narrowed the problem down to the %s substitution not working, >since if I replace %s with a file name, it prints that file from the righttray>and with the right paper size.>The printer shares are listed below. The hp8000 printer prints, >but hp8000_a3 and hp8000_a4 only spool the file. >As I said before, the print command works when typed on the command line.>Has anyone got any suggestions as to why this is happening >and how I can get around the problem.>Thanks in advance >-peter.>;/* --------------------------------------------------------------------*/>;/* HP LaserJet 8000 DN print services*/>;/* --------------------------------------------------------------------*/>[hp8000] > ; include standard print service parameters > include = /opt/samba/lib/conf/conf.printers/smb.conf.hplj8000dn > ; printer name for print service > printer = hp8000 >[hp8000_a3] > ; include standard print service parameters > include = /opt/samba/lib/conf/conf.printers/smb.conf.hplj8000dn > ; printer name for print service > printer = hp8000 > ; print command > print command = lp -o "A3 tray3" -d hp8000 %s > ; print service description > comment = HP LaserJet hp8000 DN (A3) >[hp8000_a4] > ; include standard print service parameters > include = /opt/samba/lib/conf/conf.printers/smb.conf.hplj8000dn > ; printer name for print service > printer = hp8000 > ; print command > print command = lp -o "A4 tray4" -d hp8000 %s > ; print service description > comment = HP LaserJet 8000 DN (A4) >;/* --------------------------------------------------------------------*/>; /* (smb.conf.hplj8000dn) >;/* Description: Samba configuration file for HP LaserJet 8000 DN print*/>;/* service.*/>;/* --------------------------------------------------------------------*/> ; include generic print service parameters >include = /opt/samba/lib/conf/conf.printers/smb.conf.print > ; printer name for print service >printer = hplj8000dn > ; print service description >comment = HP LaserJet 8000 DN > ; printer driver associated with print service >printer driver = HP LaserJet 8000 Series PS >;/* --------------------------------------------------------------------*/ Hi, It seems that you are running in a speed problem. By default the SYSV lp-spooler is using a reference to the position of the printfile. If the printfile is send via a network normally the file is created only temporarily. This means it is automatically removed after receiving the signal from the spooler that the file has been queued. Due to this circumstance the default print command under Samba is "lp -c -d%p %s; rm %s". This means that the spooler copies the file to its spool directory instead of using a reference. The rm command is just to make sure that the Samba spooling area is really cleaned off. I do not know why you could print before without a problem, but I believe if you extend your command with the "-c" and the ";rm %s" your problem will be solved. HTH, Axel Neumann