1826070 Members
3928 Online
109690 Solutions
New Discussion

Adding printer remotely

 
SOLVED
Go to solution
Jonathan Wegner
Occasional Advisor

Adding printer remotely

This is a restatement of my previous question to clarify some things.

I'm not trying to add a remote printer, and the .rhosts file for allowing a remote login is already in place on all my machines.

I maintain a system of HP-Tac4's that get their user information via a networked file system. What I'm attempting to do is to remotely add a printer (SCSI connection to each machine)from my server via a script.

The problem that I'm having is that the lpadmin command doesn't create the device file for the printer. Does anyone know what command does create that file? SAM will add a printer without any problems. Once a printer is created with SAM, addition of printers with the lpadmin command does not cause any problems.

Thanks
Jonathan
2 REPLIES 2
linuxfan
Honored Contributor
Solution

Re: Adding printer remotely

Hi Jonathan,

You could use mknod (man 1m mknod) to create special files. You can run this as remsh from your machine.
Another thing you could do is look at the /var/sam/log/samlog.
Look at what is sam doing (search for mknod in the logfile). Once you figure out what it is doing you can create the device file and then add the printer using the lpadmin command.


-HTH
I am RU
They think they know but don't. At least I know I don't know - Socrates
Sachin Patel
Honored Contributor

Re: Adding printer remotely

Hi Jonathan,
I uses this command on my script.
/usr/sam/lbin/lpmgr -a -xlocalname=$LPRINTER,default=n,fence=0,rc=y,is_bsd=n,remname=$PRINTER,remsys=$HOST,remcancel=rcmodel,remstatus=rsmodel

and for lpadmin
/usr/sbin/lpadmin -p$LPRINTER -orm$HOST -orp$PRINTER -mrmodel -v/dev/null -orc -ocmrcmodel -osmrsmodel
if [ $? != 0 ]; then
echo "lpadmin failure exiting"
# exit 1
fi


Sachin

Is photography a hobby or another way to spend $