Sempre più spesso ci si trova con errori frequenti di non proprio facilissima risoluzione. La gestione di reti LAN e la condivisione di file, cartelle, stampa etc, è affidata come già detto in altri post a Samba; ma spesso questo tool in coppia con Cups (applicativo di gestione stampa) ci restituisce un bel pò di errori più o meno gravi. Nel caso specifico, se si sta provando a stampare tramite cups dal pc Windows verso il server Linux potremmo ritrovarci con un output di log samba simile a questo:

[2009/06/24 22:20:09, 0] printing/print_cups.c:cups_job_submit(656)
Unable to print file to brother - client-error-document-format-not-supported

NB: Questo errore impedisce alla stampante di avviare il processo di stampa. Per risolvere la cosa dobbiamo effettuare alcune modifiche direttamente su cups come da seguito.

Risoluzione:

~# vi /etc/cups/mime.convs

Aperto il file mime.convs va decommentata (togliere il #) la stringa:

# application/octet-stream   application/vnd.cups-raw   0   -

Che diventerà chiaramente decommentandola:

application/octet-stream   application/vnd.cups-raw   0   -

Stessa modifica va affettuata sul file mime.types:

~# vi /etc/cups/mime.types

Decommentiamo, se non lo fosse già, la stringa:

# application/octet-stream

Che diventerà:

application/octet-stream

Infine modificheremo il file generale di configurazione di cups aggiungengo le seguenti stringhe:

~# vi /etc/cups/cupsd.conf
<Location /printers>
 AuthType None
 Order Deny,Allow
 Deny From None
 Allow From All
</Location>

Che modificato risulterà simile al seguente:

LogLevel info
SystemGroup sys root
# Allow remote access
Port 631
Listen /var/run/cups/cups.sock
# Enable printer sharing and shared printers.
Browsing On
BrowseOrder allow,deny
BrowseAllow all
BrowseAddress @LOCAL
DefaultAuthType Basic
<Location />
 Allow all
 Allow all
 Allow all
 # Allow shared printing...
 Order allow,deny
 Allow all
</Location>
<Location /admin>
 Encryption Required
 Allow all
 # Restrict access to the admin pages...
 Order allow,deny
</Location>
<Location /admin/conf>
 AuthType Default
 Require user @SYSTEM
 Allow all
 # Restrict access to the configuration files...
 Order allow,deny
</Location>
<Location /printers>
 AuthType None
 Order Deny,Allow
 Deny From None
 Allow From All
</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-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job CUPS-Move-Job>
 Require user @OWNER @SYSTEM
 Order deny,allow
 </Limit>
 <Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default>
 AuthType Default
 Require user @SYSTEM
 Order deny,allow
 </Limit>
 <Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After CUPS-Accept-Jobs CUPS-Reject-Jobs>
 AuthType Default
 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>

Effettuate tutte le modifiche non resta che riavviare il servizio cups:

~# /etc/rc.d/rc.cups restart

# End