Tuesday, January 27, 2015

Solaris 11: Troubleshoot printer problems ( cups)


The Common UNIX Printing System (CUPS) has integrated into Oracle Solaris and is now the default print service, replacing the LP print service. CUPS is a modular printing system that enables a system to function both as a print server and a print client. A system that is running CUPS becomes a host that can accept print requests from client systems, process those requests, then send them to the appropriate printer.

 Check installed print/cups package version

# pkg info print/cups

Name: print/cups
Summary: Common Unix Print System
Category: System/Printing
State: Installed
Publisher: solaris
Version: 1.4.5
Build Release: 5.11
Branch: 0.175.0.0.0.2.537
Packaging Date: October 19, 2011 11:08:34 AM
Size: 10.37 MB
FMRI: pkg://solaris/print/cups@1.4.5,5.11-0.175.0.0.0.2.537:20111019T110834Z

Check most recent available solaris/print/cups package versions 

# pkg search -r cups | egrep "^(INDEX|pkg.fmri)"
INDEX ACTION VALUE PACKAGE
pkg.fmri set solaris/print/cups pkg:/print/cups@1.4.5-0.175.0.0.0.2.537

 Upgrade system to the most recent fixes/updates for package print/cups in Solaris 11:

# pfexec pkg update print/cups

Test the printer with a Banner Page?

The "job-sheets" option in CUPS 1.1 allows you to specify a banner page for printing.
Look in the /usr/share/cups/banners directory for the available banner files.
# ls -l /usr/share/cups/banners/
total 14
-r–r–r– 1 root bin 157 Oct 20 2011 classified
-r–r–r– 1 root bin 161 Oct 20 2011 confidential
-r–r–r– 1 root bin 121 Oct 20 2011 labeled
-r–r–r– 1 root bin 149 Oct 20 2011 secret
-r–r–r– 1 root bin 157 Oct 20 2011 standard
-r–r–r– 1 root bin 157 Oct 20 2011 topsecret
-r–r–r– 1 root bin 161 Oct 20 2011 unclassified


Examples:
// fixed setup for a certain banner page

# lpadmin -p xerox -o job-sheets-default=standard

// fixed setup to disable banner page

# lpadmin -p xerox -o job-sheets-default=none

// selection during invocation of lp command

# lp -o job-sheets=none filename
# lp -o job-sheets=standard filename

Verify possible options for a certain queue


# lpoptions -p Xerox
auth-info-required=none copies=1 device-uri=ipp://sample-printer-hostname/ipp/ finishings=3 job-hold-until=no-hold job-priority=50 job-sheets=none,none marker-change-time=1371732515 marker-colors=none marker-levels=-1 marker-names='Print Cartridge' marker-types=toner number-up=1 printer-commands=AutoConfigure,Clean,PrintSelfTestPage printer-info=xerox printer-is-accepting-jobs=true printer-is-shared=true printer-location='Team OS' printer-make-and-model='Xerox DocuPrint N2125PS Foomatic/Postscript (recommended)' printer-state=3 printer-state-change-time=1371732515 printer-state-reasons=none printer-type=8400916 printer-uri-supported=ipp://localhost:631/printers/xerox


# lpoptions -p xerox -l
PageSize/Page Size: Letter *A4 11×17 A3 A5 B5 Env10 EnvC5 EnvDL EnvISOB5 EnvMonarch Executive Legal
Resolution/Resolution: *default 150x150dpi 300x300dpi 600x600dpi 1200x1200dpi
Duplex/Double-Sided Printing: DuplexNoTumble DuplexTumble *None
PreFilter/GhostScript pre-filtering: EmbedFonts Level1 Level2 *No

// Example:
# lp -d xerox -o PageSize=Letter [filename]
see also: http://www.cups.org/documentation.php/options.html

Collecting Problem Information for Support Call Purpose:

 1)  Set the LogLevel parameter in /etc/cups/cupsd.conf to "debug" and restart the cupsd service
  • LogLevel warn ( default )
  • LogLevel debug ( troubleshooting purpose )
     # svcadm restart application/cups/scheduler
        Keep logfile /var/log/cups/error_log  ready for analysis after certain printing attempts
Note :   please ensure to set the LogLevel parameter back to 'warn' after troubleshooting  to avoid a huge filesize of logfile /var/log/cups/error_log during normal operation 
2) Run Explorer ( version 6.0 or hiher) – to collect frile from /etc/cups and /var/log/cups  directories
CUPS related files in /opt/SUNWexplo/output/explore*

# ls -l /var/explorer/output/explorer.<hostid>.<hostname>-<date>/cups/
total 29
-rw——- 1 root root 4143 Aug 14 20:02 cupsd.conf
-rw——- 1 root root 4142 Aug 14 20:02 cupsd.conf.default
drwx—— 2 root root 4 Aug 14 20:02 logs
-rw——- 1 root root 369 Aug 14 20:02 printers.conf
-rw——- 1 root root 369 Aug 14 20:02 printers.conf.O
-rw——- 1 root root 186 Aug 14 20:02 snmp.conf
-rw——- 1 root root 75 Aug 14 20:02 etc/security/auth_attr.d/cups
-rw——- 1 root root 55 Aug 14 20:02 etc/security/prof_attr.d/cups
-rw-r–r– 1 root root 1772 Jul 31 11:34 var/svc/log/application-cups-scheduler:default.log

Note : If explorer is not available or cannot be gathered, collect tarfiles of directories of /etc/cups and /var/log/cups 

Troubleshooting CUPS issues

 Step 1:  check CUPS related SMF services

# svcs '*cups*'
STATE STIME FMRI
disabled Mar_21 svc:/application/cups/in-lpd:default
online Mar_21 svc:/application/cups/scheduler:default
# svcs -p application/cups/scheduler:default
STATE STIME FMRI
online Mar_21 svc:/application/cups/scheduler:default
Mar_21 575 cupsd


Step 2:  check queue with lpstat 

# lpstat -l -p hp
printer hp now printing hp-8. enabled since Sat Apr 14 09:17:00 2012
Waiting for job to complete…
Form mounted:
Content types: any
Printer types: unknown
Description: hp
Alerts: none
Location:
Connection: direct
Interface: /etc/cups/ppd/hp.ppd
On fault: no alert
After fault: continue
Users allowed:
(all)
Forms allowed:
(none)
Banner required
Charset sets:
(none)
Default pitch:
Default page size:
Default port settings:

Step 3: Set LogLevel parameter in /etc/cups/cupsd.conf
as shown in "Information Gathering section"
  • Check logfile /var/log/cups/error_log
  • Check content of /etc/cups
  • Check /etc/cups/printers.conf
  • Check /etc/cups/cupsd.conf
  • Check spool directory /var/spool/cups/
Typically, 3 files are expected per printjob
i.e. for
/var/spool/cups/c00012 # The cNNNNN files are binary files in the IPP message format.
/var/spool/cups/d00012-001 # controlfile
/var/spool/cups/d00012-002 # datafile

Step4: use DTrace scripts in directory /usr/dtrace/DTT/ to monitor processes while printing    

# /usr/dtrace/DTT/opensnoop -a
TIME STRTIME UID PID FD ERR PATH ARGS
478810465530 2012 Apr 14 09:12:59 0 1836 -1 2 /var/ld/ld.config lp -d hp /etc/hosts\0
478810465688 2012 Apr 14 09:12:59 0 1836 3 0 /lib/libc.so.1 lp -d hp /etc/hosts\0
478810468234 2012 Apr 14 09:12:59 0 1836 3 0 /usr/lib/libcups.so.2 lp -d hp /etc/hosts\0
478810468988 2012 Apr 14 09:12:59 0 1836 3 0 /usr/lib/libgss.so.1 lp -d hp /etc/hosts\0
478810470081 2012 Apr 14 09:12:59 0 1836 3 0 /usr/lib/libpthread.so.1 lp -d hp /etc/hosts\0
478810470718 2012 Apr 14 09:12:59 0 1836 -1 2 /usr/share/locale/C/cups_C.po lp -d hp /etc/hosts\0
478810471125 2012 Apr 14 09:12:59 0 1836 3 0 /proc/1836/psinfo lp -d hp /etc/hosts\0
478810471441 2012 Apr 14 09:12:59 0 1836 3 0 /system/volatile/name_service_door lp -d hp /etc/hosts\0
478810471915 2012 Apr 14 09:12:59 0 1836 -1 2 /root/.cups/client.conf lp -d hp /etc/hosts\0
478810471978 2012 Apr 14 09:12:59 0 1836 -1 2 /root/.cupsrc lp -d hp /etc/hosts\0
478810472041 2012 Apr 14 09:12:59 0 1836 -1 2 /etc/cups/client.conf lp -d hp /etc/hosts\0
478810472377 2012 Apr 14 09:12:59 0 1836 4 0 /usr/lib/libsocket.so.1 lp -d hp /etc/hosts\0
478810472791 2012 Apr 14 09:12:59 0 1836 4 0 /lib/libnsl.so.1 lp -d hp /etc/hosts\0
478810473956 2012 Apr 14 09:12:59 0 1836 4 0 /etc/netconfig lp -d hp /etc/hosts\0
478810474707 2012 Apr 14 09:12:59 0 1836 4 0 /dev/udp lp -d hp /etc/hosts\0
478810474987 2012 Apr 14 09:12:59 0 1836 4 0 /dev/udp lp -d hp /etc/hosts\0
478810494832 2012 Apr 14 09:12:59 0 1836 4 0 /usr/lib/libssl.so.1.0.0 lp -d hp /etc/hosts\0
478810495455 2012 Apr 14 09:12:59 0 1836 4 0 /lib/libcrypto.so.1.0.0 lp -d hp /etc/hosts\0
478810515393 2012 Apr 14 09:12:59 0 1836 -1 2 /etc/cups/lpoptions lp -d hp /etc/hosts\0
478810515471 2012 Apr 14 09:12:59 0 1836 -1 2 /root/.lpoptions lp -d hp /etc/hosts\0
478810518645 2012 Apr 14 09:12:59 0 1836 5 0 /etc/hosts lp -d hp /etc/hosts\0
478810511895 2012 Apr 14 09:12:59 0 1431 14 0 /var/run/cups/certs/0 /usr/sbin/cupsd -C /etc/cups/cupsd.conf\0
478810520275 2012 Apr 14 09:12:59 0 1431 14 0 /var/spool/cups/0000002d /usr/sbin/cupsd -C /etc/cups/cupsd.conf\0
478810521028 2012 Apr 14 09:12:59 0 1431 14 0 /var/spool/cups/0000002d /usr/sbin/cupsd -C /etc/cups/cupsd.conf\0
478810523600 2012 Apr 14 09:12:59 0 1431 -1 2 /var/spool/cups/a00007 /usr/sbin/cupsd -C /etc/cups/cupsd.conf\0
478810546480 2012 Apr 14 09:12:59 0 1835 4 0 /system/volatile/tzsync /usr/sbin/dtrace -n \n /*\n * Command line arguments\n */\n inlin e int OPT_dump \t\0
478810546896 2012 Apr 14 09:12:59 0 1835 4 0 /usr/share/lib/zoneinfo/localtime /usr/sbin/dtrace -n \n /*\n * Command line arguments\n */\n inline int OPT_dump \t\0
478811525222 2012 Apr 14 09:13:00 0 1431 -1 2 /var/spool/cups/c00007 /usr/sbin/cupsd -C /etc/cups/cupsd.conf\0
478811525699 2012 Apr 14 09:13:00 0 1431 11 0 /var/spool/cups/c00007 /usr/sbin/cupsd -C /etc/cups/cupsd.conf\0

No comments:

Post a Comment