# Samba/Cups printer sharing

## s3ntient

Yesterday I configured Samba And Cups to share a printer on my gentoo machine.  Everything worked, I could print on the shared printer from a Windows machine no problem.

Today, it no longer works.  I haven't rebooted either machine, nor have I changed anything in the config files since it worked.

Checking the samba logs, I see:

```
[2008/03/07 18:13:04, 0] printing/pcap.c:pcap_cache_reload(159)

  Unable to open printcap file cups for read!

[2008/03/07 18:13:04, 0] printing/pcap.c:pcap_cache_reload(159)

  Unable to open printcap file cups for read!

[2008/03/07 18:13:07, 1] smbd/service.c:make_connection_snum(1033)

  golgotha (192.168.0.2) connect to service DESKJET_656C initially as user nobody (uid=65534, gid=65534) (pid 10262)

[2008/03/07 18:13:24, 0] libsmb/clientgen.c:cli_receive_smb(112)

  Receiving SMB: Server stopped responding

[2008/03/07 18:13:24, 0] rpc_client/cli_pipe.c:rpc_api_pipe(790)

  rpc_api_pipe: Remote machine GOLGOTHA pipe \spoolss fnum 0x4000returned critical error. Error was Call timed out: server did not respond after 10000 milliseconds

[2008/03/07 18:13:24, 0] rpc_client/cli_pipe.c:cli_rpc_pipe_open_noauth(2271)

  cli_rpc_pipe_open_noauth: rpc_pipe_bind for pipe \spoolss failed with error NT_STATUS_IO_TIMEOUT

[2008/03/07 18:13:24, 1] libsmb/clientgen.c:cli_rpc_pipe_close(387)

  cli_rpc_pipe_close: cli_close failed on pipe \spoolss, fnum 0x4000 to machine GOLGOTHA.  Error was Call timed out: server did not respond after 10000 milliseconds

```

Here are my configs:

smb.conf

```

[global]

   workgroup = WORKGROUP

   browseable = yes

   netbios name = enoch

   server string = Samba Server %v

   printcap = cups

   load printers = yes

   cups options = "raw"

   use client driver = yes

   printing = cups

   log file = /var/log/samba/log.%m

   max log size = 50

   hosts allow = 192.168.0.0/24 127.0.0.1

   map to guest = bad user

   security = user

   encrypt passwords = yes

   socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

[printers]

   comment = All Printers

   path = /var/spool/samba

   browseable = yes

   guest ok = yes

   writable = no

   printable = yes

   public = yes

[print$]

   path = /var/lib/samba/printers

   browseable = yes

   read only = yes

   write list = @adm root

   guest ok = yes

[public]

   path = /home/public

   public = yes

   only guest = yes

   writable = yes

   printable = no

[DESKJET_656C]

   comment = HP

   printable = yes

   path = /var/spool/samba

   public = yes

   guest ok = yes

   printer admin = root

```

cupsd.conf

```

LogLevel info

User lp

Group lp

SystemGroup lpadmin

Port 631

Listen /var/run/cups/cups.sock

Browsing On

BrowseOrder allow,deny

BrowseAllow @LOCAL

BrowseAddress @LOCAL

DefaultAuthType Basic

<Location />

  Order allow,deny

  Allow @LOCAL

</Location>

<Location /admin>

  Order Deny,Allow

  Deny From All

  Allow From 192.168.0.*

</Location>

<Location /admin/conf>

  Order allow,deny

  Allow From 192.168.0.*

</Location>

<Policy default>

  <Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscri$

    Require user @OWNER @SYSTEM

    Order deny,allow

  </Limit>

  <Limit Pause-Printer Resume-Printer Set-Printer-Attributes Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-N$

    AuthType Basic

    Require user @SYSTEM

    Order deny,allow

  </Limit>

  <Limit Cancel-Job CUPS-Authenticate-Job>

    Require user @OWNER @SYSTEM

    Order deny,allow

  </Limit>

  <Limit All>

    Order deny,allow

  </Limit>

</Policy>

```

printers.conf

```

<Printer DESKJET_656C>

Info DESKJET_656C

Location Server

DeviceURI hp:/usb/DESKJET_656C?serial=TH21M1602N

State Idle

StateTime 1204749907

Accepting Yes

Shared Yes

JobSheets none none

QuotaPeriod 0

PageLimit 0

KLimit 0

OpPolicy default

ErrorPolicy stop-printer

</Printer>

```

Any ideas as to why I suddenly can't print?

----------

## s3ntient

*bump*

----------

## albright

Do you get an error if you try to browse the samba share from

the windows machine?

what happens if you restart samba (i.e. /etc/init.d/samba restart)?

----------

## s3ntient

I can browse the samba share without errors, restarting samba and cups had no effect on the printing problem :/

The "Printers and Faxes" thing on the Windows machine shows the status of the printer as ready, it just won't print on it anymore.

----------

## albright

I suppose you've already tried this, but what happens

if you reboot the windows machine, remove the printer,

reboot the windows machine, add the printer again,

reboot and windows machine, try printing ?

----------

