UnixPedia : HPUX / LINUX / SOLARIS: Printer
Showing posts with label Printer. Show all posts
Showing posts with label Printer. Show all posts

Saturday, October 18, 2014

RICOH : How to create a Ricoh Printer on HPUX server.

This document will explain you to create a ricoh printer queue with Ricoh driver and installer script. Download the software from Ricoh support  site.
This will work for :
  1. landscape and double-side
  2. Portrait and single-side
  3. landscape andSingle-side
  4. Portrait and double-side
romano:root:/home/usermw/ricoh_
# ll
total 330
-rw-r--r--   1 root       root          2156 Jun 17  2005 AP610.1
-rw-rw-rw-   1 root       root          3287 Jun 17  2005 EULA
drwxr-xr-x   2 root       root            96 Jun 17  2005 SampleFiles
-rw-rw-r--   1 root       root         26950 Mar  8  2006 UserManual
-rw-rw-r--   1 root       root          4071 Jun 17  2005 aix_head
-rw-rw-r--   1 root       root          6495 Jan 12  2006 aix_tail
-rw-rw-r--   1 root       root          4303 Jun 17  2005 hp_head
-rw-rw-r--   1 root       root          6988 Jan 12  2006 hp_tail
-rw-rw-r--   1 root       root          3563 Jun 17  2005 lnx_head
-rw-rw-r--   1 root       root          6199 Jan 12  2006 lnx_tail
-rwxr-xr-x   1 root       root          6810 Jun 17  2005 rpconfig
-rw-rw-r--   1 root       root          3637 Jun 17  2005 sco_head
-rw-rw-r--   1 root       root          6805 Jan 12  2006 sco_tail
-rw-rw-r--   1 root       root         30533 Jun 17  2005 sol_610
-rw-rw-r--   1 root       root          3999 Jun 17  2005 sun_head
-rw-rw-r--   1 root       root          7380 Jan 12  2006 sun_tail
-rwxr-xr-x   1 root       root          9517 Jun 17  2005 uninstall
-rwxr-xr-x   1 root       root         27459 Jun 17  2005 unix_installer

romano:root:/home/usermw/ricoh_
# ./unix_installer

romano:root:/home/usermw/ricoh_
# lpadmin -xun31

romano:root:/home/usermw/ricoh_
# ./unix_installer

#############################################
##
## Ricoh UNIX Printing Solution
## Installation Program
##
## For support, please contact Ricoh Technical Support
##
#############################################

SOFTWARE LICENSE AGREEMENT

YOU, THE END USER, SHALL USE THIS SOFTWARE("THE SOFTWARE") ACCORDING TO THE
TERMS OF THIS AGREEMENT. BY LOADING THE SOFTWARE INTO ANY COMPUTER, YOU ARE
AGREEING TO BE BOUND BY THESE TERMS. IF YOU DO NOT ACCEPT THE TERMS OF THIS
AGREEMENT, YOU MAY NOT LOAD THIS SOFTWARE INTO ANY COMPUTER.

Grant of License
The Software is licensed for use by you for the equipment packaged with the
Software or designated by its supplier ("the equipment"). You are permitted to
use the Software on any computer which permits electronic access to the
equipment. You are not permitted to rent or lease the Software or to transfer
your rights under this license to a third party.

Acceptance
You shall be deemed to have accepted the terms of this Agreement by loading
the Software into any computer.

Duration
This license is effective until terminated. The license will terminate where
you fail to comply with the terms of this Agreement. Upon termination, you
agree to destroy all copies of the Software and its documentation.


Ownership of Software
You own, if any, only the magnetic media on which the Software has been
delivered. It is an express condition of this Agreement that the title and
ownership of the Software shall be retained by its owners.


Copying
The Software and its documentation are the subject of Copyright. You may not
make any copies nor cause others to make copies of the Software except such
copies as are necessary for licensed use and one copy for operational
security. Any such copies are subject to the conditions of this Agreement.
You may not modify, adapt, merge, translate, reverse engineer, decompile,
disassemble or create derivative works based on the whole or any part of the
Software or its associated documentation. You may be held legally responsible
for any copyright infringement, unauthorized transfer, reproduction or use
of the Software or its documentation.

Limitation of Warranty
The media, if any, not the Software contained therein, is warranted to the
original purchaser against defects in material and workmanship for a period of
one year from the date of original purchase. Defective media will be replaced
when it is returned to your supplier, postage prepaid, along with a copy of
the purchase receipt.

THESE RIGHTS ARE YOUR SOLE AND EXCLUSIVE REMEDY, WHETHER IN TORT, CONTRACT, OR
OTHERWISE. IN NO EVENT SHALL SUPPLIER, OWNER OF THE SOFTWARE OR ITS LICENSORS
BE LIABLE FOR DAMAGES (INCLUDING ANY FOR LOSS OF INFORMATION, PROFITS, SAVINGS
OR BUSINESS INTERRUPTION OR OTHER DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL
OR SPECIAL DAMAGES) ARISING OUT OF THE SOFTWARE OR THE USE THEREOF, OR THE
INABILITY TO USE THE SOFTWARE.


Exporting Law
You acknowledge that the export of the Software is governed by the export
control laws of the United States and other countries. You agree to comply
with all such export control laws.


Governing Law and Jurisdiction
If any provision or portion of this Agreement shall be found to be illegal,
invalid or unenforceable, the remaining provisions shall remain in full force
and effect. This Agreement shall be governed by the laws of California, USA
and is subject to the jurisdiction of the Federal District courts for the
Central District of California by a judge and not a jury.
Do you agree ? [y/n] y

If you want to terminate execution of this program,       
press CTRL+C (or Delete key for SCO OpenServer) at any time.

Your system appears to be running HP-UX B.11.11.
Is this correct ? [y/n] y

Enter printer's hostname.

This hostname MUST exist in your hosts file or
in naming service such as DNS, NIS, etc.

Hostname: JJCUSNBP0628.pxxp.na.pnp.com   NOTE  ## Mention FQDN here no IP

Please enter printer name.
(Maximum characters allowed for the printer name is 11)
(The characters must be letters, digits and underscores)
This is the printer you will print to [Default = lp_JJCUSNBP0628.pxxp.na.pnp.com]: un31
 Would you like to install Device Option Support? [y/n] y

#################################################

  Product Name                 : Aficio AP610N
  Printer Hostname          : JJCUSNBP0628.pxxp.na.pnp.com
  Printer Name                   : un31
  Device Option Support : Y

#################################################

Is this correct ? [y/n] y

Creating a printer entry, please stand by...
/usr/lib/lpshut: scheduler not running
destination "rp_un31" now accepting requests
printer "rp_un31" now enabled
destination "un31" now accepting requests
printer "un31" now enabled
scheduler is running
Printer entry "un31" created successfully.

You can verify the installation by issuing the following command.
                lp -d un31 your_file

Do you want to set up the default values for this queue now? [Y/n] n

 You can set up this queue by run "rpconfig" <queue_name> .

romano:root:/home/usermw/ricoh_
# lpstat -oun31
printer queue for un31
Printer status : Idle.(Energy Saver Mode.)
Online/Offline : Online.
no entries.
no entries

romano:root:/home/usermw/ricoh_
# enable un31
enable: printer "un31" was already enabled

romano:root:/home/usermw/ricoh_
# accept un31
accept: destination "un31" was already accepting requests

Thursday, October 2, 2014

HPUX : Printer Issue



It is good practice to create a backup of the spooler configuration every time you change it. Here's the command to save the configuration:
# /usr/sam/lbin/lpmgr -S -xsavedir=/var/sam/lp
This will save all configuration data to the directory: /var/sam/lp.
To restore your configuration later use :
# /usr/sam/lbin/lpmgr -R -xsavedir=/var/sam/lp
The corresponding SAM menu is: SAM : Printers and Plotters -> Save/Restore Spooler Configuration
Restarting the spooling system on a regular system
First shutdown the line printer request scheduler:
# /usr/sbin/lpshut
scheduler stopped ß this is what you should see
Report the status of the line printer request scheduler:
# lpstat -r
scheduler is not running ß this is what you should see
Start the line printer request scheduler:
# /usr/sbin/lpsched
scheduler is running ß this is what you should see
Report the status of the line printer request scheduler:
# lpstat -r
scheduler is running ß this is what you should see
Restarting the spooling system in a printer package
If you want to restart lpsched on a system with a printer package, you must first check the status of the printer package (use cmviewcl) and if it's not running, then you can use 'cmmodpkg –e …' to re-enable the package autostart and/or 'cmrunpkg …' to restart the package. If the package is already running, then simply restart the scheduler with /usr/sbin/lpsched. Make sure you check for the existence of the lock file. That files needs to be removed if you want to have the cluster software monitor lpsched again.
Problems outside the LP spooling system might impact printing. Therefore it's always a good idea to start with checking /var/adm/syslog/syslog.log and dmesg.
Some examples:
a file-system full on /var/spool/lp may cause severe problems, like corruption of the spooler. Can easily be checked by:
$ bdf /var/spool/lp
Filesystem kbytes usedavail %used Mounted on
/dev/vgprnSAP/lvvarspoollpSAP
4112384 2514423 150048963% /var/spool/lp
Other messages like 'cannot fork' may also prevent LP from doing his work. If you see this, then check the setting of maxuprc. This parameters needs to be equal to (numberofprinters*3)+10. If it is less on a busy system you may run out of processes for the spooler.
Example:
$ kctune -v maxuprc
Tunable maxuprc
DescriptionMaximum number of processes for each non-root user
Module pm
Current Value 1200
Value at Next Boot 1200
Value at Last Boot 1200
Default Value 256
Constraintsmaxuprc >= 3
maxuprc <= nproc - 5
Can Change Immediately or at Next Boot
Now check the most obvious obstacle: is your scheduler running at all?
# lpstat -t |more
scheduler is running
...
If you see the following line instead restart the scheduler (see 'Restarting the spooling system').
# lpstat -t | more
scheduler is not running
...
If the scheduler says it's running check the remainder of your 'lpstat -t' output for any errors and check the spooler log file for any errors:
# more /var/spool/lp/log
lpsched: FIFO: Apr 1 04:21 n
lpsched: FIFO: Apr 1 04:21 r 1450 1333246910 0 912 0 0 90 hpx160 SAP_OPER MD45 -
MD45-912 SAP_OPER MD45 Apr 1 04:21
lpsched: CHILD: Apr 1 04:21 MD45 912 0000
lpsched: FIFO: Apr 1 04:21 m MD45 c 24798
…
If there are any errors you need to take a closer look at them. Sometimes they will point to permission problems or directories and files which are missing. Finding and resolving the cause of these errors should resolve the spooler hang. If for instance the request directory under /var/spool/lp is missing, you will see the following error message in the log file :
lpsched: can't open request directory
While lpstat may show:
# lpstat -t
...
cannot examine spooling area
...
Recreating the request directory either manually or by restoring it from backup will resolve the problem in the above case. If you do not see any obvious error messages in the log file proceed with the next step.
If there are no errors try to restart the scheduler (see 'Restarting the spooling system').
Sometimes the scheduler simply refuses to stop. 'lpshut' claims it stopped the scheduler but 'lpstat -r' still says it is running. If the restart does not solve the hang it is time now for the first step of the '
SpoolKick procedure'.
If you do not see the lpsched process running you very likely have a permissions problem with /var/adm/lp/log or any of its path components. To check the permission, please have a look at section: 'LP Spooler permissions'. Then try printing a test print job, and if your spooler still is hung proceed with the next step. Check the log file /var/adm/lp/log for any error messages.
If you execute this procedure on one of the EMEA print packages, then it's good to first put the package in maintenance mode. This might prevent unnecessary package switching. See 'Notes on EMEA printer cluster package'. Don't forget to remove the lock-file after the problem is solved.
SpoolKick: First Step
Often the scheduler simply got into a situation where it can no longer finish all processes and delete its lock files. After doing all that manually, check if users can print again.
NOTE: If you cannot stop your users from submitting new print jobs while fixing the problem you need to find a way to prevent them from interfering with the spooler cleanup. It is difficult to correct a hung spooler while new requests keep being submitted. One possibility is to temporarily change permissions of the /usr/bin/lp command to '000'. Be aware that this can potentially cause problems with your application programs using the LP Spooler.
Shut down the scheduler:
# /usr/sbin/lpshut          
Are there still lp processes running ? 'lp processes' include lp, lpsched, interface scripts, hpnpg or lpstat processes.
# ps -ef | grep -E 'lp|hpnpf'
Kill all lp processes:
# kill <lp_process_id>
Check if all processes are really gone. If not, then use 'kill -9'.
# ps -ef | grep -E 'lp|hpnpf'
Delete temporary files, not all of them may exist:
# cd /var/spool/lp
# rm FIFO SCHEDLOCK CLD_FIFO Toutputq *.lock
Restart lpsched with additional logging enabled:
# /usr/sbin/lpsched -v –a
Check if the lpsched process is running:
# ps -ef |grep lpsched
NOTE: If you changed permissions on the lp command change them back to '4555'.
If printing still doesn't work, it's time for the second step.
SpoolKick: Second Step
If the cleanup of the temporary files didn't solve the problem, then probably the spooler outputq is corrupt. The only way to fix this situation is to clear the outputq and delete all requests in /var/spool/lp/request/<printer_name>/*.
This time you will lose ALL of the files that are currently scheduled for printing! So before you proceed find out whether your users can afford to lose their current print jobs. If they desperately need them, back those files up. The next step will tell you how to do all of that. But if your users are able to submit those jobs once again, it will be faster and safer to skip the first step and just ask them to print their old jobs after the spooler is back up. There are also limitations to the restoration of the options used for the print jobs, so we're not sure that all jobs will print correctly.
Make sure the spooler is down. (See above lpshut, kill, …)
Save all requests to a temporary directory:
# cp -rp /var/spool/lp/request /tmp/request
instead of /tmp/request you can use any other directory of your choice, you only need to make sure that you have sufficient space available
Now delete the requests
# rm /var/spool/lp/request/*/*
If (very) many printers are set up this might fail and you are better off using a script like the following :
#!/usr/bin/sh
cd /var/spool/lp/request
for i in *
do
cd $i
rm c*; rm d*; rm t*
cd ..
done
Now clean up the outputq on top of that. DO NOT DELETE this file, just delete its contents:
# > /var/spool/lp/output
Start the scheduler
# /usr/sbin/lpsched -v –aFdffasfasf
Print all requests again
After the spooler runs smoothly again all requests can be sent to their respective printers. The name of the directory in /tmp/request corresponds to the name of the printer the requests were sent to. All files starting with 'c' are 'job description files'. Your actual data files that you would like to print all start with 'd'. Files starting with 't' are temporary files and can be ignored. Below script will try to resubmit the files, and it will already try to process the –O options. Other options, like K (=number of copies), are silently ignored.
If different options were used with your print requests you have to find and use them when printing your jobs. For each data file that you wish to print there is a corresponding job file which lists all options invoked; f.i. for data file dA0096beach check cA0096beach:
# more cA0096beach
Hbeach
Proot
Jburnjet1-96
C
Lroot
BTitle <- title 'lp ... -t"Title"'
K3 <- number of copies 'lp ... -n3'
Onb postscript <- options used 'lp ... -onb -opostscript'
T/opt/hpnp/testfiles/ps<- original file to be printed
FdA0096beach
fdA0096beach
fdA0096beach
fdA0096beach
UdA0096beach
N/opt/hpnp/testfiles/ps
Mroot<- mail a message to user 'lp ... -m'
A4 <- priority 'lp ... -p4'
#/usr/bin/sh
OLDREQ=/tmp/request # this is the directory where you copied your files to !
cd $OLDREQ
for QUEUE in *
do
            DIR=${OLDREQ}/${QUEUE}
            cd ${DIR}
            for i in $(find . -mtime -1 -name 'c*') # only process recent files
            do
                        [[ $i != +(./c*) ]] && continue
                        name=${i#./c}
                        C=c${name}
                        D=d${name}
                        [[ ! -f $D ]] && { echo $D does not exist
                                                continue
                                                }
# dbg               grep "^O" $C
# dbg               echo $i $name $D
                        OPT=""
                        for option in $(grep "^O" $C)
                        do
                                    case $option in
                                                "O") continue ;;
                                                O*) OPT="${OPT} -o${option#O}" ;;
                                                -*) OPT="${OPT} ${option#O}" ;;
                                                *) OPT="${OPT} -o${option#O}" ;;
                                    esac
                        done
                        cat - <<-EOT
                        about to:
                        lp -d${QUEUE} $OPT ${DIR}/${D}
                        mv ${C} REQUEUED.${C}
                        mv ${D} REQUEUED.${D}
                        EOT
                        lp -d${QUEUE} $OPT ${DIR}/${D}
                        mv ${C} REQUEUED.${C}
                        mv ${D} REQUEUED.${D}
#                      echo "press enter to continue \n" # uncomment the lines to test
#                      read a # the script first on a few files
                        sleep 1 # the sleep is needed so we don't overload the spooler
            done
done
SpoolKick: Third Step
If the previous steps did NOT resolve your spooler hang most likely the configuration files are corrupt which are used by the spooler to determine which printers are set up and what their current state is. You should try to get those from your backup if available. If that fails too you have no other choice than to set up your spooler from scratch again.
There are several methods to restore a previously working printer configuration if your printer status files have become corrupt:
Restore pstatus and qstatus from backup
Stop the scheduler and recover the following files from backup:
/var/spool/lp/pstatus
/var/spool/lp/qstatus
Restart the scheduler and try printing.
If more than pstatus/qstatus have become corrupt you can recover the LP Spooler directories from your backup after stopping the scheduler:
/etc/lp
/var/spool/lp
/var/adm/lp
Use SAM to restore the spooler state. This assumes that you did save the spooler configuration previously. You can check the following directory if you are not sure that you have done so, it should contain your printer files:
# ll -R /var/sam/lp
See also: '
Backup/Restore the spooler configuration'
You can verify LP Spooler permissions by using the swverify command on the PrinterMgmt fileset:
# swverify -v -x autoselect_dependencies=false PrinterMgm
If the above command reports any errors or warnings check /var/adm/sw/swagent.log. Look for any kind of permission or ownership related problems. Correct the problems you find and try to restart the scheduler again.
Swverify will not check permissions of configured printers. If you still suspect a permission problem verify the LP Spooler directories: /etc/lp, /var/spool/lp and/var/adm/lp manually.
The permissions that should be set on the lp directories and configuration files, are listed here. Most of the directories are owned by user lp and group bin.
/etc/lp directory
drwxr-xr-x lp bin /etc/lp
/etc/lp contents
drwxr-xr-x lp bin cinterface
drwxr-xr-x lp bin class
drwxr-xr-x lp bin info
drwxr-xr-x lp bin interface
drwxr-xr-x lp bin member
drwxr-xr-x lp bin sinterface
/etc/lp/interface content
-rwxr-xr-x1 lp lp<size> <date> <time> <interface>
...
/var/spool directory
dr-xr-xr-x bin bin /var/spool
/var/spool/lp directory
drwxr-xr-x lp bin            /var/spool/lp
/var/spool/lp contents
prw------- lp lp CLD_FIFO
prw------- lp lp FIFO
-rw-r----- lp lp SCHEDLOCK
lr-xr-xr-x bin bin cmodel -> /usr/lib/lp/cmodel
lr-xr-xr-x bin bin fonts -> /usr/lib/lp/fonts
lrwxrwxrwx lp lp log -> /var/adm/lp/log
lrwxrwxrwx lp lp lpd.log -> /var/adm/lp/lpd.log
lr-xr-xr-x bin bin model -> /usr/lib/lp/model
-rw-r--r-- lp lp outputq
-rw-r--r-- lp lp pstatus
-rw-r--r-- lp lp qstatus
drwxr-xr-x lp bin receive
drwxr-xr-x lp bin request
-rw-r----- lp lp seqfile
lr-xr-xr-x bin bin smodel -> /usr/lib/lp/smodel
/var/spool/lp/request contents
drwxr-xr-x2 lp lp <queue>