[Samba] Re: CUPS, APW

Jeff Hardy hardyjm at potsdam.edu
Fri Dec 3 23:04:36 GMT 2004


So far I have an addprinter command that eventually works with a bit of
effort.  

FIRST STEP: When I click Finish on the "Completing the Add Printer
Wizard" dialog, lpadmin is run correctly with all of my parameters to
add the printer to CUPS.  I print to STDOUT the name of the printer,
because this is supposed to trigger Samba to re-read its config and pick
up the printer.  This does not seem to work, so I trigger a Samba
restart (SIGHUP still won't pick up my new printer) by touching a file
which triggers a daemon I wrote to restart Samba.  Now I get "Unable to
Install Printer.  Access is denied" and this in my log:

[2004/12/03 17:33:36, 1] smbd/service.c:make_connection_snum(648)
  fritzvmxp (137.143.102.100) connect to service print$ initially as
user hardyjm (uid=500, gid=500) (pid 3600)
[2004/12/03 17:35:46, 1] smbd/service.c:close_cnum(836)
  fritzvmxp (137.143.102.100) closed connection to service print$
[2004/12/03 17:35:46, 0] smbd/connection.c:register_message_flags(220)
  register_message_flags: tdb_fetch failed
[2004/12/03 17:35:47, 0] smbd/connection.c:register_message_flags(220)
  register_message_flags: tdb_fetch failed


SECOND STEP: Because of my restart, the queue WILL pop up and I can
click OK and Cancel on the APW to get back to the printers window.  The
queue is driverless, but is all set as far as CUPS is concerned.  If I
go into Properties, I am told the driver is not installed... no sweat, I
click No.  I go to the Advanced tab and install the driver.  When I
click OK here, the addprinter command is run a second time...I have an
if statement in my script to check to see if the queue exists and if so,
do nothing.  Unfortunately, something then renames my queue (in Samba,
not CUPS) to the Driver Name that I have installed.  The Share Name is
left untouched.  No errors in the logs.


THIRD STEP: Since the queue now has a fairly useless name, I need to go
into Properties for a second time and change the name (or do a
right-click rename).  At this point, the queue is all set and further
edits to any properties of the printers exhibit no further anomalies.

As you can see this is not terribly elegant.  I would feel more
comfortable if it were not for the fact that we have a large printer
base and our Helpdesk is always adding printers.

Any suggestions?



On Fri, 2004-12-03 at 16:54, Jeff Hardy wrote:
> The addprinter command (would have helped if I mentioned that, huh?).  I
> find I am constantly fighting the dreaded Access Denied Errors.  The
> script I have that worked previously in a source install environment
> just took the parameters from the APW and stuffed them into lpadmin.  It
> was always problematic, and I am trying to stomp that out for this go
> around.
> 
> 
> 
> On Fri, 2004-12-03 at 16:31, Michael Lueck wrote:
> > What exactly do you need to script...???
> > 
> > -- 
> > Michael Lueck
> > Lueck Data Systems
> > 
> > Remove the upper case letters NOSPAM to contact me directly.



More information about the samba mailing list