[Samba] Problems installing printerdriver after successful upload to samba-2.2.5

Thomas Reifferscheid reiffer at kph.uni-mainz.de
Sun Aug 11 00:15:01 GMT 2002


Here is what I do. It gets explained step by step.
At the end of this mail you will find my references used in the text by
[0] and so on.

- starting with initial setup
- getdriverdir NT x86
- uploading files with smbclient prompt; cd W32X86
- addriver
- addprinter
- debian:/scratch/W32X86# rpcclient debian -d 1 -A  /scratch/authfile.txt -c
"enumdrivers"
- debian:/usr/local/samba/var/locks# strings ntdrivers.tdb
- getdriverdir Windows 4.0
- uploading with smbclient prompt; cd WIN40..
- addriver
- addprinter
- enumdrivers
Everything looks quite good until here.
- Installation of the drivers from win98

Note: Debug output is available on 3 webservers for having a close look.
Links are in the text.


- Starting with my initial smb.conf [0] and my addprinter.pl [1].

/usr/local/samba/printer/ looks like this:
drwxr-xr-x    2 root     root         4096 Aug 11 09:00 W32X86
drwxr-xr-x    2 root     root         4096 Aug 11 09:00 WIN40
The subdirectories contain nothing.


- debian:~# rpcclient debian -d 1 -A  /scratch/authfile.txt -c "getdriverdir
\"Windows NT x86\""
cmd = getdriverdir "Windows NT x86"
        Directory Name:[\\debian\print$\W32X86]

- uploading the XP-Drivers as derived by the mkprinterpkg.pl script from
imprints. Note,
its a HP Lasersword 8000 DN PCL 6 driver for XP. get it here:
http://h20000.www2.hp.com/bizsupport/TechSupport/DriverDownload.jsp?prodNum=
C4087A&prodName=hp+LaserJet+8000dn+printer&locale=en_US&taskId=8418&taskName
=download+drivers+%26+software&prodTypeId=18972&prodSeriesId=25471&prodSerie
sName=hp+LaserJet+8000+printer+series

debian:/scratch/W32X86# smbclient file://debian/print$ -d 1 -A
/scratch/authfile.txt -c "prompt; cd W32X86; put hpbf022e.dll; put
hpbf022g.dll; put hpbf022i.dll; put hpbf022i.pmd; put hpbf022k.dll; put
hpdcmon.dll; put hpbafd32.dll; put  hpbf022f.dll; put  hpbf022h.dll; put
hpbf022i.hlp; put  hpbf022j.dll;  put hpbftm32.dll;"
Domain=[EGAL] OS=[Unix] Server=[Samba 2.2.5]
putting file hpbf022e.dll as \W32X86\hpbf022e.dll (306.1 kb/s) (average
306.1 kb/s)
putting file hpbf022g.dll as \W32X86\hpbf022g.dll (2577.8 kb/s) (average
2469.0 kb/s)
putting file hpbf022i.dll as \W32X86\hpbf022i.dll (2308.6 kb/s) (average
2433.9 kb/s)
putting file hpbf022i.pmd as \W32X86\hpbf022i.pmd (1379.9 kb/s) (average
2368.2 kb/s)
putting file hpbf022k.dll as \W32X86\hpbf022k.dll (2432.4 kb/s) (average
2380.7 kb/s)
putting file hpdcmon.dll as \W32X86\hpdcmon.dll (1691.2 kb/s) (average
2357.0 kb/s)
putting file hpbafd32.dll as \W32X86\hpbafd32.dll (1100.0 kb/s) (average
2308.1 kb/s)
putting file hpbf022f.dll as \W32X86\hpbf022f.dll (1702.6 kb/s) (average
2273.2 kb/s)
putting file hpbf022h.dll as \W32X86\hpbf022h.dll (2670.2 kb/s) (average
2379.8 kb/s)
putting file hpbf022i.hlp as \W32X86\hpbf022i.hlp (1493.5 kb/s) (average
2359.5 kb/s)
putting file hpbf022j.dll as \W32X86\hpbf022j.dll (2389.5 kb/s) (average
2362.6 kb/s)
putting file hpbftm32.dll as \W32X86\hpbftm32.dll (1523.4 kb/s) (average
2332.2 kb/s)


Everything looks quite good, as I find all the files in
/usr/loca/samba/printer/W32X86:
debian:/usr/local/samba/printer/W32X86# ls
hpbafd32.dll  hpbf022f.dll  hpbf022h.dll  hpbf022i.hlp  hpbf022j.dll
hpbftm32.dll
hpbf022e.dll  hpbf022g.dll  hpbf022i.dll  hpbf022i.pmd  hpbf022k.dll
hpdcmon.dll

- Now I use the rpcclient adddriver command:
debian:/scratch/W32X86# rpcclient debian -d 1 -A  /scratch/authfile.txt -c
"adddriver \"Windows NT x86\" \"HP LaserJet 8000 Series PCL
6:HPBF022G.DLL:HPBF022I.PMD:HPBF022E.DLL:HPBF022I.HLP:NULL:RAW:hpbf022i.hlp,
hpbf022i.dll,hpbftm32.dll,hpbf022f.dll,hpbafd32.dll,hpbf022j.dll,hpbf022g.dl
l,hpbf022k.dll,hpbf022h.dll,hpbf022e.dll,hpbf022i.pmd,hpdcmon.dll\""
cmd = adddriver "Windows NT x86" "HP LaserJet 8000 Series PCL
6:HPBF022G.DLL:HPBF022I.PMD:HPBF022E.DLL:HPBF022I.HLP:NULL:RAW:hpbf022i.hlp,
hpbf022i.dll,hpbftm32.dll,hpbf022f.dll,hpbafd32.dll,hpbf022j.dll,hpbf022g.dl
l,hpbf022k.dll,hpbf022h.dll,hpbf022e.dll,hpbf022i.pmd,hpdcmon.dll"
Printer Driver HP LaserJet 8000 Series PCL 6 successfully installed.

Now all the files are in /usr/local/samba/printer/W32X86/3/
Looks still good here.

- Now, rpcclient addprinter:

rpcclient debian -d 10 -A  /scratch/authfile.txt -c "addprinter \"lj8000\"
\"lj8000\" \"HP LaserJet 8000 Series PCL 6\" \"Samba Printer Port\""
>output1.txt 2>&1

it gives me: result was NT_STATUS_UNSUCCESSFUL

but why ? let's see the *complete* debug output at:
It's WERR_ACCESS_DENIED
Now the my addprinter.pl script has added the following lines to my
/etc/printcap, as well as to my smb.conf file:
lj8000:\
        :lp=:rm=thomas.at.home.org:rp=raw:\
        :sd=/tmp:\
        :max#0:\
        :sh:\

and for my smb.conf:

[lj8000]
        printable = yes
        guest ok = yes
        browsable = yes
        public = yes
        print command = lpr -l -r -P %p %s


Here is the output
http://134.93.42.1/~lard/output1.txt or
http://134.93.134.124/~thomas/output1.txt
or at http://plantage.dynodns.net/~lard/output1.txt
Hopefully on of the 3 locations will be online.

If I just redo the same command I get the WERR_PRINTER_ALREADY_EXISTS
error-message. You can see the result here:
http://134.93.42.1/~lard/output2.txt or
http://134.93.134.124/~thomas/output2.txt
or at http://plantage.dynodns.net/~lard/output2.txt

But it looks more or less ok:

debian:/scratch/W32X86# rpcclient debian -d 1 -A  /scratch/authfile.txt -c
"enumdrivers"
cmd = enumdrivers

[Windows NT x86]
Printer Driver Info 1:
        Driver Name: [HP LaserJet 8000 Series PCL 6]

debian:/usr/local/samba/var/locks# strings ntdrivers.tdb
TDB file
&INFO/version
BBB0
&DRIVERS/W32X86/3/HP LaserJet 8000 Series PCL 6
HP LaserJet 8000 Series PCL 6
Windows NT x86
\print$\W32X86\3\HPBF022G.DLL
\print$\W32X86\3\HPBF022I.PMD
\print$\W32X86\3\HPBF022E.DLL
\print$\W32X86\3\HPBF022I.HLP
\print$\W32X86\3\hpbf022i.hlp
\print$\W32X86\3\hpbf022i.dll
\print$\W32X86\3\hpbftm32.dll
\print$\W32X86\3\hpbf022f.dll
\print$\W32X86\3\hpbafd32.dll
\print$\W32X86\3\hpbf022j.dll
\print$\W32X86\3\hpbf022g.dll
\print$\W32X86\3\hpbf022k.dll
\print$\W32X86\3\hpbf022h.dll
\print$\W32X86\3\hpbf022e.dll
\print$\W32X86\3\hpbf022i.pmd
\print$\W32X86\3\hpdcmon.dll


messages.tdb contains:
TDB file
PID/18184
HP LaserJet 8000 Series PCL 6



Ok, now the same stuff for the Win98 Driver:

- debian:/scratch/WIN40# rpcclient debian -d 1 -A  /scratch/authfile.txt -c
"getdriverdir \"Windows 4.0\""
cmd = getdriverdir "Windows 4.0"
        Directory Name:[\\debian\print$\WIN40]

- debian:/scratch/WIN40# smbclient file://debian/print$ -A
/scratch/authfile.txt -d 1 -c "prompt; cd WIN40; put HPBF0220.DRV; put
HPBF0221.DLL; put  HPBFAB32.DLL; put UPWININI.DLL; put HP8000_6.exe; put
HPBF0220.HLP; put  HPBFAB.DDU; put HPBFTM16.DLL; put  hpdcmon.dll; put
HPBAFD16.DLL; put  HPBF0220.PMD; put  HPBFAB16.DLL ; put HPBFTM32.DLL;\""
Domain=[EGAL] OS=[Unix] Server=[Samba 2.2.5]
putting file HPBF0220.DRV as \WIN40\HPBF0220.DRV (2948.7 kb/s) (average
2948.7 kb/s)
putting file HPBF0221.DLL as \WIN40\HPBF0221.DLL (2614.7 kb/s) (average
2890.1 kb/s)
putting file HPBFAB32.DLL as \WIN40\HPBFAB32.DLL (696.4 kb/s) (average
2828.5 kb/s)
putting file UPWININI.DLL as \WIN40\UPWININI.DLL (1333.3 kb/s) (average
2784.8 kb/s)
putting file HP8000_6.exe as \WIN40\HP8000_6.exe (1066.7 kb/s) (average
2736.0 kb/s)
putting file HPBF0220.HLP as \WIN40\HPBF0220.HLP (1584.0 kb/s) (average
2701.2 kb/s)
putting file HPBFAB.DDU as \WIN40\HPBFAB.DDU (1209.7 kb/s) (average 2659.9
kb/s)
putting file HPBFTM16.DLL as \WIN40\HPBFTM16.DLL (46.9 kb/s) (average 2602.9
kb/s)
putting file hpdcmon.dll as \WIN40\hpdcmon.dll (1727.3 kb/s) (average 2578.4
kb/s)
putting file HPBAFD16.DLL as \WIN40\HPBAFD16.DLL (424.7 kb/s) (average
2528.4 kb/s)
putting file HPBF0220.PMD as \WIN40\HPBF0220.PMD (1590.9 kb/s) (average
2502.8 kb/s)
putting file HPBFAB16.DLL as \WIN40\HPBFAB16.DLL (52.3 kb/s) (average 2452.5
kb/s)
putting file HPBFTM32.DLL as \WIN40\HPBFTM32.DLL (1875.0 kb/s) (average
2429.7 kb/s)


- debian:/scratch/WIN40# rpcclient debian -d 3 -A  /scratch/authfile.txt -c
"adddriver \"Windows 4.0\" \"HP LaserJet 8000 Series PCL
6:HPBF0220.DRV:HPBF0220.PMD:HPBF0220.DRV:HPBF0220.HLP:NULL:RAW:HPBF0220.DRV,
HPBF0221.DLL,HPBFAB32.DLL,UPWININI.DLL,HP8000_6.exe,HPBF0220.HLP,HPBFAB.DDU,
HPBFTM16.DLL,hpdcmon.dll,HPBAFD16.DLL,HPBF0220.PMD,HPBFAB16.DLL,HPBFTM32.DLL
\""

Printer Driver HP LaserJet 8000 Series PCL 6 successfully installed.

- A new addprinter should give us the expected error as can be seen in
http://134.93.42.1/~lard/output3.txt or
http://134.93.134.124/~thomas/output3.txt
or at http://plantage.dynodns.net/~lard/output3.txt
.

rpcclient debian -d 1 -A  /scratch/authfile.txt -c "enumdrivers"
cmd = enumdrivers

[Windows 4.0]
Printer Driver Info 1:
        Driver Name: [HP LaserJet 8000 Series PCL 6]


[Windows NT x86]
Printer Driver Info 1:
        Driver Name: [HP LaserJet 8000 Series PCL 6]




EVERYTHING LOOKS QUITE WELL UNTIL NOW.

Now I open a connection to the samba server from my win98 workstation.
I see the lj8000 in the shares.
        Sharename      Type      Comment
        ---------      ----      -------
        print$         Disk
        lj8000         Printer
        IPC$           IPC       IPC Service (debian server (Samba 2.2.5))

When I click on it, a new dialog raises in my win98:
"for using this printer within win98, additional driver installation is
needed"
"do you use this printer for printing from DOS ? " -> NO

Then I get the default window for chossing a printer from the list
containing
drivers for at least 2000 printers.There is NO hp lasterjet 8000 around.
nowhere.

You can see the debuglevel 10 output at:

http://134.93.42.1/~lard/output4.txt or
http://134.93.134.124/~thomas/output4.txt
or at http://plantage.dynodns.net/~lard/output4.txt

For all that I know thats the same behaviour for Windows XP.
I'm sorry as this is only a private testing-environment. The same things
have occured at work, where I have a XP test-box.


What is wrong ?


Help, suggestions, ideas, hints, docs etc is appreciated

Thomas

below are my initial smb.conf and my addprinter.pl script.





[0] Initial smb.conf:

[global]
log file = /usr/local/samba/var/log.%m
debuglevel = 10
show add printer wizard = yes
printer admin = root, at ntadmin
add printer command = /usr/local/samba/bin/addprinter.pl
   printing = bsd
   printcap name = /etc/printcap
   load printers = yes
   guest account = root # // yes, I know. only for testing!
    guest ok = yes
    security = share

[printers]
   comment = All Printers
   browseable = yes
   path = /tmp
   printable = yes
   public = yes
   writable = yes
   create mode = 0777

[print$]
   path=/usr/local/samba/printer
   browsable=yes
   guest ok = yes
   write list = @ntadmin,root


[1] /usr/local/samba/bin/addprinter.pl:
#!/usr/bin/perl -w
use strict;
my($printer_name,$share_name,$port_name,$driver_name,$location,$win9x_locati
on) = @ARGV;

open(PRINTCAP,">>/etc/printcap");
print PRINTCAP $printer_name .":\\\n";
print PRINTCAP "\t:lp=:rm=server:rp=raw:\\\n";
print PRINTCAP "\t:sd=\/tmp:\\\n";
print PRINTCAP "\t:max#0:\\\n";
print PRINTCAP "\t:sh:\\\n";
close(PRINTCAP);

open(SMBCONF,">>/usr/local/samba/lib/smb.conf");

print SMBCONF "\n";
print SMBCONF "[".$printer_name."]\n";
print SMBCONF "\tprintable = yes\n";
print SMBCONF "\tguest ok = yes\n";
print SMBCONF "\tbrowsable = yes\n";
print SMBCONF "\tpublic = yes\n";
print SMBCONF "\tprint command = lpr -l -r -P %p %s\n";
print SMBCONF "\n";





More information about the samba mailing list