Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sco 6 and Samba Printer

Status
Not open for further replies.

snight123

Technical User
Mar 12, 2007
28
0
0
GB
Hi,

I have just got Sco 6 and need to set up some windows printers on the sco box. I used to use VisionFS on my 5.0.5 Box but as VisionFS is not available for Sco 6 in need an alternative.

I have installed samba and the Sco box is visable in network neighbourhood on the windows boxes, I can ping the windows boxes, but after reading through loads of man pages i cant find a way of setting up the windows shared printers on the Sco box.

The versions of windows range from Win98 to WinXP, the printers are shared in the normal way.

Any help or pointers would be great.

Thanks
 
You just need a different interface file, which is very similar to the way VisionFS handled this process.
Throw this file in your /usr/spool/lp/model directory. Set PERMS and ownership to match the other entries in that directory. Then create your printers using this model.
You'll find the original version of this script (with internal commented instructions) here:
/usr/share/doc/packages/samba/examples/printing/smbprint.sysv

Code:
-----------cut----------------
#!/bin/sh
shift;shift;shift;shift;shift

server=pcname
service=sharename
password="-U user%password"

(
# NOTE You may wish to add the line `echo translate' if you want automatic
# CR/LF translation when printing.
       echo translate
        echo "print -"
        cat $*
) | /usr/bin/smbclient "\\\\$server\\$service" $password -N > /dev/null
exit $?
--------------cut---------------


"Proof that there is intelligent life in Oregon. Well, Life anyway.
 
HI,

Thanks for the info, although i'm not sure what to do next.

What do i need to call the file that i copied into /usr/spool/lp/model?

How do i create the printer? The printer is connected to a windows PC called "Media" and the printer is shared as "KYO1000". The only printers i've managed to configure and add to the Sco 6 box were on JetDirect boxes and i put these in through - Scoadmin -> Printers -> HP Network Printer Manager.

 
Name the file "smbprint" in /usr/spool/lp/model.

You can create the printer in much the same way:
Scoadmin - Printers - Add - Local.
Set the printer name as desired. Select the smbprint model and set the port to "/dev/null". Once the printer has been added, you will need to modify the resulting file in /usr/spool/lp/admins/lp/interfaces/{printername} to give it the correct "server" (Media) and "service" (KYO1000). You will also need to change user%password to be something valid on the "Media" PC. For example, you might create a new local user account called "unix" with a password of "print". Then the interface file would contain this:


server=Media
service=KYO1000
password="-U unix%print"


"Proof that there is intelligent life in Oregon. Well, Life anyway.
 
Hi,

I have followed your instructions and i now have a printer called media. I have edited the file called "media" that it created in /usr/spool/lp/admins/lp/interfaces/ and put in the server, sharename etc but i still cant get anything out the printer. I must be missing something again.

Is it possible for the printers that i create to be shown on the network neighbourhood in the Sco Box, ie \\sco6test\media?

Thanks again in advance.
 
You can test the basic SAMBA connectivity using this command:

# smbclient -LMedia -Uunix%print

Assuming the Servername and account name/password are correct, you should get a list of all the shared resources.
(Similar to "NET VIEW \\SERVERNAME" on a PC).

You may also want to use the original source file for the interface script (pathname referenced in my first post). If you created a file from my earlier post using CUT/PASTE, there's a good chance the script may not contain the proper UNIX line termination.


"Proof that there is intelligent life in Oregon. Well, Life anyway.
 
Hi,

I have managed to create the printers using the CUPS web administration page. However they dont appear in the Scoadmin --> Printers list, i can install them on my windows box and can print to it but cant print to them using lp -d media /etc/somefileorother.

Is it possible to be able to print from the lp command?
 
HI,

I have created the printer as you suggested in Scoadmin --> Printers --> Printer manager, with the type as smbclient and port as /dev/null. I have then edited the created file in /var/spool/lp/admins/lp/interfaces and replaced server=pcname, service=sharename and password="-U user%password" with server=Media, service=KYO1000, password="-U unix%print". Do i need to insert the server, service and password in this part aswell or just at the top of the file?

) | /usr/bin/smbclient "\\\\$server\\$service" $password -N > /dev/null
exit $?
--------------cut---------------

When i do an lpstat -t, i know have a printer showing called media, but when i do lp -d /etc/hosts i dont get anything out of the printer.

I have done # smbclient -LMedia -Uunix%print and it shows me the printer and any shares available. But nothing comes out the printer.

Thanks
 
when i do lp -d /etc/hosts i dont get anything out of the printer
Try this instead:
lp -d media /etc/hosts

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
HI,

Sorry it was my typo. i was doing lp -d media /etc/hosts. But still nothing comes out.
 
Have you gone back to using the ORIGINAL interface script? I probably should never have posted what looked like a valid script. It was only meant to be an example. If you used that hunk of text, you might have problems with line termination. Can you post your actual interface script?

"Proof that there is intelligent life in Oregon. Well, Life anyway.
 
The snippet we use is

Code:
        for file in $files
        do
           cat "$file" | xtod >> /usr/tmp/temp.$$
           echo "print /usr/tmp/temp.$$" \
           | /usr/bin/smbclient "\\\\$server\\$service" -N -P
        done

this assumes a public printer (no password).
you could try it this way first and once you have it working you can turn any security back on.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top