Please consider a donation to the Higher Intellect project. See https://preterhuman.net/donate.php or the Donate to Higher Intellect page for more info.

BSD LPR and SGI

From Higher Intellect Vintage Wiki
                                     Silicon Graphics Technical Support
            ____________________________________________________________

            Before You Configure the BSD LPR Print Spooler

            SGI        IRIX 5.X does not support configuring the BSD LPR  print
            spooler  locally  (you  can         not have the printer physically
            connected to an SGI        system).  If you  want        to  be        a  print
            server  then  you  will  need to refer to the Communications
            guide for setting up printers for the SYSTEM V  LP        spooling
            system.
            The        BSD lpr        print spooler will allow you to        access        printers
            that  are  attached        to other systems on the        network.  Please
            be sure to check the other system,        or  contact  the  system
            administrator to verify the        type of        spooling system        they are
            using.  Generally speaking,        if they         have  an  /etc/printcap
            file  configured  they  are        using the BSD LPR print        spooling
            system.
            You        can  not  use  the  System  Manager's  printer        tool  to
            configure  a  BSD  LPR  spooling system, nor can you use the
            mknetpr(1M)        command        for configuring        a network printer.  Both
            of        these  utilities  only        support        the SYSTEM V LP        spooling
            system.
            This document will assist you in  configuring  the        IRIS  so
            that  you will be able to submit and print your files on the
            BSD         print        server.          Please  make        sure  that  the          System
            Administrator  of  the  print  server  puts        your hostname in
            their /etc/hosts.equiv file, and that your        IP  address  and
            hostname  appear in        their /etc/hosts file.        You will need to
            add        the print server's  IP        address         and  hostname        to  your
            /etc/hosts        file.        If  your  documents don't print        once you
            have configured the        BSD print spooler please see the section
            ``Troubleshooting        the  BSD  LPR  Spooling         System.''   The
            troubleshooting section will take you to the point where you
            can        see a copy of your document on the print server.  If the
            document  disappears  from        the   server's         queue         without
            printing,  contact        the  System Administrator of that system
            for        further        assistance.

            ____________________________________________________________

            September 09, 1993                -jst                          Page 1


                                      Silicon Graphics Technical Support
            ____________________________________________________________

            Verifying the BSD LPR Subsystem was        Properly Installed

            You        should be able to verify the version  of  software  that
            you        are running by entering        the following command:
                 #  uname  -a
            Enter the following        command        to verify that the BSD LPR print
            spooling system was        properly installed.
                 #  versions  long  |  grep  eoe2.sw.bsdlpr
            Your output        should be similar to:
                 eoe2.sw.bsdlpr           etc/init.d/bsdlpr
                 eoe2.sw.bsdlpr           etc/printcap
                 eoe2.sw.bsdlpr           etc/rc0.d/K26bsdlpr
                 eoe2.sw.bsdlpr           etc/rc2.d/S61bsdlpr
                 eoe2.sw.bsdlpr           usr/bsd/lpq
                 eoe2.sw.bsdlpr           usr/bsd/lpr
                 eoe2.sw.bsdlpr           usr/bsd/lprm
                 eoe2.sw.bsdlpr           usr/bsd/lptest
                 eoe2.sw.bsdlpr           usr/etc/lpc
                 eoe2.sw.bsdlpr           usr/etc/lpd
                 eoe2.sw.bsdlpr           usr/etc/pac
                 eoe2.sw.bsdlpr           usr/lib/lpf
                 eoe2.sw.bsdlpr           var/spool/lpd
            The        BSD spooler is not loaded by default.  Most  users  will
            have  to  use  inst(1M)  and  select  the  manual option, to
            install this subsystem.
            Please make        sure you do the        versions command (versions  long
            |  grep  lpr)  to  verify that you have the        entire subsystem
            loaded.  Just having an /etc/printcap file is not enough.
            If you don't have the subsystem installed and would        like  to
            do the installation        please refer to        your sytems's manuals.


            ____________________________________________________________

            September 09, 1993                -jst                          Page 2


                                      Silicon Graphics Technical Support
            ____________________________________________________________

            Configuring        the /etc/printcap file

            You        will need  to  edit  the  /etc/printcap         file  manually.
            Please  make  sure        you  format  the entries correctly.  The
            /etc/printcap file expects information in a         format         similar
            to /etc/termcap.
            This document will use two examples.  The first example will
            show  you how to configure the printer configuration file in
            two         lines.          The  second  example        will  show  you         how  to
            configure  each  option  of         the  printcap        file on        separate
            lines.  There will be explanations of both examples.
            Please note        that the printcap  file         is  very  sensitive  to
            syntax  errors.   The  name         field        must  begin at the first
            character on a line        of the /etc/printcap file.  The         printer
            names  must         be  separated by pipe symbols (the vertical bar
            ``|'').  The name line  must  be  terminated  with        a  colon
            followed  by a backslash (``:\'').        Make sure that there are
            no spaces, tabs, or        any other character after the backslash.
            The         definition  lines  must  begin         with  a  tab  character
            followed  by  a colon (``:''), followed by the field you are
            defining, followed by an equal sign.   The        definition  line
            must end with a colon.  If you are using multiple lines, see
            example two.
            There is only one name and four definition fields that  must
            be defined.         They are:

            name  This should be all  the  names  the  printer        will  be
                  accessed  as.         If it includes        ``lp'',        and is the first
                  such entry in        the printcap  file,  ``lpr''  will  work
                  without  specifying  a  printer  name.   The names are
                  separated with pipe symbols.

            :lp=  (blank) This specifies the device to        which  the  file
                  should  be  printed.        No  files are printed locally so
                  this is left blank.

            :rm=  (remote machine name)        This is        the name of  the  system
                  that has the printer physically connected.

            :rp=  (remote printer name)        This is        the name of  the  remote
                  printer  on  the  remote system that you are trying to
                  access.

            :sd=  (spool  directory)  The  name         of  your  local   spool
                  directory.   If  you        don't  use the default directory
                  /var/spool/lpd, you will need        to create the  directory
                  by using the mkdir(1M) command.

            ____________________________________________________________

            September 09, 1993                -jst                          Page 3


                                      Silicon Graphics Technical Support
            ____________________________________________________________

            Printcap Examples

            Example Number One

                 sleepy|lp|sleepyprinter:\
                         :lp=:rm=snowwhite.story.land:rp=doc:sd=/var/spool/lpd:
            Example number one can access the printer by  the  following
            names:
                 sleepy
                 lp
                 sleepyprinter
            The        remote system (where the printer is physically attached)
            is called:
                 snowwhite.story.land
            The        name of        the printer on the print server        (remote         system)
            is called:
                 doc
            The        local spool directory is called:
                 /var/spool/lpd

            Example Number Two

                 sleepy|lp|sleepyprinter:\
                         :lp=:\
                         :rm=snowwhite.story.land:\
                         :rp=doc:\
                         :sd=/var/spool/lpd:
            Example number two can access the printer by  the  following
            names:
                 sleepy
                 lp
                 sleepyprinter
            The        remote system (where the printer is physically attached)
            is called:
                 snowwhite.story.land
            The        name of        the printer on the print server        (remote         system)
            is called:
                 doc
            The        local spool directory is called:
                 /var/spool/lpd


            ____________________________________________________________

            September 09, 1993                -jst                          Page 4


                                      Silicon Graphics Technical Support
            ____________________________________________________________

            Attempting to Print        Using the LPR command

            Now        that you have the /etc/printcap         file  configured,  make
            sure  that        the  daemon  is         running.   Enter  the following
            command:
                 #  ps        -ef  |        grep  lpd
            Your system        should return something        similar        to:
                 root        195    1   0   11:06:04          ?        0:00 /usr/etc/lpd
                 root  1293  753   2   13:20:39         ttyq6        0:00 grep lpd
            The        /usr/etc/lpd at        the end        of the lines indicates that  the
            daemon  is        running.   If you only got one line back (``grep
            lpd''), then start the lpd daemon by entering the  following
            command:
                 #  /usr/etc/lpd
            Now        if you do ``ps -ef | grep lpd''        you should see        2  lines
            returned to        you.
            From examples one and two note that         the  printer  could  be
            accessed  by three names (sleepy, lp and sleepyprinter).  By
            default the        lpr command will look for the first lp entry  in
            the        /etc/printcap file.  If        this is        not found, then        you will
            need to do one of two things:

              1.  Whenever you enter the lpr command you must use the -P
                  option to specify a printer name other than lp.
                       %  lpr  -Psleepyprinter        filename

              2.  In your shell        you can         set  the  environment        variable
                  PRINTER  to  the  name of the        printer        you wish to use.
                  In the C shell:
                       %  setenv  PRINTER  sleepy
                  In the Bourne        shell:
                       $   PRINTER=sleepy;  export  PRINTER

              3.  Now you can enter the        command:
                       lpr  filename

              4.  After        submitting your        request        to the printer.         You can
                  see  if  your         job  has  made        it to the print        spooling
                  queue        by entering the        following command:
                       #  lpq
                  Your system should return something similar to:
                       doc is ready and        printing
                       Rank  Owner  Job         Files               Total Size
                       1st    nina  113         filename      851 bytes


            ____________________________________________________________

            September 09, 1993                -jst                          Page 5


                                      Silicon Graphics Technical Support
            ____________________________________________________________

            Troubleshooting the        BSD LPR        Spooling System

            If your print request doesn't make it to the queue:

              1.  Check        for error messages

              2.  Double check the command that        you entered.

              3.  Try submitting the /etc/group        file to        the queue.   The
                  file you submitted might have        had problems.

            If your print request makes        it to the queue        and  never  gets
            to the print server:

              1.  Do you have the print        server's IP address and        hostname
                  in the /etc/hosts file?

              2.  Does the print server         name  match  the  name         in  the
                  /etc/hosts  file?   Do  they match the hostname of the
                  print        server?

              3.  Did you get the error        message        that says...
                       Waiting for remote queue        to be enabled.
                  This usually means that your hostname        is  not         in  the
                  print        server's /etc/hosts.equiv file.
            If your print request disappears from the queue, and doesn't
            print or prints garbage.

              1.  Become root and enter        the commands:
                       #  /usr/etc/lpc        stop  lp   (or your printername)
                       #  lpr  /etc/group
                       #  cd  /var/spool/lpd           (or your spool directory)
                       #  ls  -l
                  Your system should return something similar to:
                       -rw-rw----  1 root   lp          69 Aug 23 14:02   cfA117tls
                       -rw-rw----  1 root   lp         227 Aug 23 14:02   dfA117tls
                       -rwxr-----  1 root   lp           0 Aug 23 14:01   lock
                       -rw-rw-r--  1 root   lp          25 Aug 23 14:46   status

              2.  Check        the contents of        the control file:
                       #  cat  cfA117tls
                  Your system should return something similar to:

                  Htls                H   the        hostname that sent the print request
                  Proot                P   the        person who sent        the request
                  Jgroup        J   the        jobname


            ____________________________________________________________

            September 09, 1993                -jst                          Page 6


                                      Silicon Graphics Technical Support
            ____________________________________________________________

            Troubleshooting the        BSD LPR        Spooling System

                  Ctls                C   class/hostname
                  Lroot                L   the        person who sent        the request
                  fdfA117tls        f   name of the        file to        print
                  UdfA117tls        U   name of the        file to        remove after printing
                  N/etc/group        N   the        original file name

              3.  Check        the copy of the        print file.
                  It is        suggested that you use more(1)
                  just in case your test file is not as        short
                  as the /etc/group file.
                  The df file should look exactly like the file        you
                  attempted to print.
                  In this case the file        dfA117tls should be exactly the        same
                  as the /etc/group file.
                       #  more        dfA117tls
                  The system should return something similar to:
                       sys::0:root,bin,sys,adm
                       root::0:root
                       daemon::1:root,daemon
                       bin::2:root,bin,daemon
                       adm::3:root,adm,daemon
                       mail::4:root
                       uucp::5:uucp
                       rje::8:rje,shqer
                       lp::9:
                       nuucp::10:nuucp
                       user::20:
                       other::995:
                       demos:*:997:
                       guest:*:998:

              4.  Now  that  you  have        verified  that        the  request  is
                  properly spooling on the local system, check the print
                  server.   You         may  need  to        contact          their          system
                  administrator        first.        You will need the root password,
                  and once you enter the stop command on their system no
                  one  will see        their print request print.  It will just
                  remain in the        queue.        Make  sure  that  there         are  no
                  requests in the queue        that are currently printing.  It
                  would        be ideal if there were no requests currently  in
                  the queue.

              5.  On the print server log  in  as  root         and  enter  the
                  command:
                       #  /usr/etc/lpc        stop  lp

            ____________________________________________________________

            September 09, 1993                -jst                          Page 7


                                      Silicon Graphics Technical Support
            ____________________________________________________________

            Troubleshooting the        BSD LPR        Spooling System

              6.  On the local system enter the        command
                       #  /usr/etc/lpc        start  lp

              7.  On the print server ``cd'' to        the spool directory.  If
                  you don't know where the spool directory is, cat(1) or
                  more(1) the /etc/printcap file and look at what is set
                  in the sd: variable.

              8.  On the print server, after changing directories to the
                  spool        directory enter        the following command:
                       #  ls  -l
                  The print server should return something similar to:
                       -rw-r----x  1 root     4        Aug 15 10:27   .seq
                       -rw-rw----  1 root    69        Aug 23 14:02   cfA117tls.csd.sgi.com
                       -rw-rw----  1 root   227        Aug 23 14:02   dfA117tls
                       -rwxr------ 1 root     0        Aug 23 14:01   lock
                       -rw-rw-r--  1 root    25        Aug 23 14:46   status

              9.  Now check the        contents of the        control        file.
                       #  cat  cfA117tls.csd.sgi.com
                  The print server should return something similar to:

                       Htls             H         the hostname that sent        the print request
                       Proot             P         the person who        sent the request
                       Jgroup             J         the jobname
                       Ctls             C         class/hostname
                       Lroot             L         the person who        sent the request
                       fdfA117tls    f         name of the file to print
                       UdfA117tls    U         name of the file to remove after printing
                       N/etc/group   N         the original file name

             10.  The df file should look  exactly  like  the  file  you
                  attempted  to         print.         In this case the print        server's
                  dfA117tls file should         be  exactly  the  same         as  the
                  dfA117tls file that was on your system.
                       #  more        dfA117tls
                  The system should return something similar to:
                       sys::0:root,bin,sys,adm
                       root::0:root
                       daemon::1:root,daemon
                       bin::2:root,bin,daemon
                       adm::3:root,adm,daemon
                       mail::4:root
                       uucp::5:uucp
                       rje::8:rje,shqer
                       lp::9:


            ____________________________________________________________

            September 09, 1993                -jst                          Page 8


                                      Silicon Graphics Technical Support
            ____________________________________________________________

            Troubleshooting the        BSD LPR        Spooling System

                       nuucp::10:nuucp
                       user::20:
                       other::995:
                       demos:*:997:
                       guest:*:998:

             11.  On the print server enter the        following command:
                       #  /usr/etc/lpc        start  lp
                  Your file should now print on        the printer.  It  should
                  look        exactly        like the output        of the more command.  If
                  it doesn't then contact the  System  Administrator  of
                  the print server.


            ____________________________________________________________

            September 09, 1993                -jst                          Page 9


                                      Silicon Graphics Technical Support
            ____________________________________________________________

            Integrating        The AT&T Spooler With The BSD LPR Print        Spooler


            ____________________________________________________________
           |                         Support Statement                       |
           |___________________________________________________________|
           |                   SGI IRIX 5.X        does not  support               |
           |                   configuring        the BSD        LPR print               |
           |                   spooler locally (you         can  not               |
           |                   have         the  printer  physically               |
           |                   connected to        an  SGI         system).               |
           |                   If  you  want  to  be  a print               |
           |                   server then you will         need  to               |
           |                   refer  to  the  Communications               |
           |                   guide for setting up         printers               |
           |                   for        the  SYSTEM V LP spooling               |
           |                   system.                                       |
           |                   However, SGI        system users have               |
           |                   requested         any        available               |
           |                   information on  this         subject,               |
           |                   whether    or    not          it   is               |
           |                   supported.                                       |
           |___________________________________________________________|

            You        can  not  use  the  System  Manager's  printer        tool  to
            configure  a  BSD  LPR  spooling system, nor can you use the
            mknetpr(1M)        command        for configuring        a network printer.  Both
            of        these  utilities  only        support        the SYSTEM V LP        spooling
            system.
            This document will assist you in  configuring  the        IRIS  so
            that  other        systems        will be        able to        submit print jobs to the
            LPR        spooler, which will then pass the job to the LP         spooler
            for        local printing.
            Before beginning to         use  this  document,  you  should  have
            already configured and tested the LP print spooler.

            ____________________________________________________________

            September 9,1993                -jst                          Page 1


                                      Silicon Graphics Technical Support
            ____________________________________________________________

            Verifying the BSD LPR Subsystem was        Properly Installed

            You        should be able to verify the version  of  software  that
            you        are running by entering        the following command:
                 #  uname  -r
            Enter the following        command        to verify that the BSD LPR print
            spooling system was        properly installed.
                 #  versions  long  |  grep  eoe2.sw.bsdlpr
            Your output        should be:
                 eoe2.sw.bsdlpr           etc/init.d/lpd
                 eoe2.sw.bsdlpr           etc/printcap
                 eoe2.sw.bsdlpr           etc/rc0.d/K26lpd
                 eoe2.sw.bsdlpr           etc/rc2.d/S61lpd
                 eoe2.sw.bsdlpr           usr/bsd/lpq
                 eoe2.sw.bsdlpr           usr/bsd/lpr
                 eoe2.sw.bsdlpr           usr/bsd/lprm
                 eoe2.sw.bsdlpr           usr/bsd/lptest
                 eoe2.sw.bsdlpr           usr/etc/lpc
                 eoe2.sw.bsdlpr           usr/etc/lpd
                 eoe2.sw.bsdlpr           usr/etc/pac
                 eoe2.sw.bsdlpr           usr/lib/lpf
                 eoe2.sw.bsdlpr           var/spool/lpd
            The        BSD spooler is not loaded by default.  Most  users  will
            have  to  use  inst(1M)  and  select  the  manual option, to
            install this subsystem.
            Please make        sure you execute the versions command  (versions
            long  | grep eoe2.sw.lpr) to verify        that you have the entire
            subsystem loaded.  Just having an /etc/printcap file is  not
            enough.
            If you don't have the subsystem installed and would        like  to
            do        the  installation  please  refer  to your Release Notes,
            Installation guide or the System Administrator's Guide.


            ____________________________________________________________

            September 9,1993                -jst                          Page 2


                                      Silicon Graphics Technical Support
            ____________________________________________________________

            Configuring        the /etc/printcap file

            You        will need  to  edit  the  /etc/printcap         file  manually.
            Please  make  sure        you  format  the entries correctly.  The
            /etc/printcap file expects information in a         format         similar
            to /etc/termcap.
            This document will show you        an example of how  to  configure
            each  option  of the printcap file on separate lines.  There
            will be explanations of both examples.
            Please note        that the printcap  file         is  very  sensitive  to
            syntax  errors.   The  name         field        must  begin at the first
            character on a line        of the /etc/printcap file.  The         printer
            names  must         be  separated by pipe symbols (the vertical bar
            ``|'').  The name line  must  be  terminated  with        a  colon
            followed  by a backslash (``:\'').        Make sure that there are
            no spaces, tabs, or        any other character after the backslash.
            The         definition  lines  must  begin         with  a  tab  character
            followed  by  a colon (``:''), followed by the field you are
            defining, followed by an equal sign.   The        definition  line
            must end with a colon.  If you are using multiple lines, see
            example two.
            There is only one name and five definition fields that  must
            be specified.  They        are:

            name  This should be all  the  names  the  printer        will  be
                  accessed  as.          It  should  include  ``lp'' so ``lpr''
                  without a printer  name  will         work.         The  names  are
                  separated with pipe symbols.

            :lp=  (line        printer) The name of the  device  to  use.   Use
                  /dev/null.

            :sd=  (spool  directory)  The  name         of  your  local   spool
                  directory.   If  you        don't  use the default directory
                  /var/spool/lpd, you will need        to create the  directory
                  by using the mkdir(1M) command.

            :lf=  (log        file)  This  is          the        LPR   log   file.    Use
                  /var/spool/lpd/lp-log.

            :sh          (supress header) This         will  supress        the  LPR  header
                  (banner)  page.   It        has  no         affect        on the LP banner
                  page.

            :of=  (output filter) This is the name of the filter to send
                  all  output  through.          Use /var/spool/lp/etc/lprtolp.
                  You will create this file in this procedure.

            ____________________________________________________________

            September 9,1993                -jst                          Page 3


                                      Silicon Graphics Technical Support
            ____________________________________________________________

            Configuring        the /etc/printcap file

            Printcap example(/etc/printcap)

                 lp:\
                         :lp=/dev/null:\
                         :sd=/var/spool/lpd:\
                         :lf=/var/spool/lpd/lp-log:\
                         :sh:\
                         :of=/var/spool/lp/etc/lprtolp:
            The        printer        can be accessed        by the following name:
                 lp
            The        local spool directory is called:
                 /var/spool/lpd
            The        device where the LPR spooler will actually  output  data
            is        /dev/null.   This  is  because the data        will actually be
            sent to the        LP spooler by lprtolp before LPR can output it.
            The        log file for LPR is:
                 /var/spool/lpd/lp-log
            The        output filter for LPR is:
                 /var/spool/lp/etc/lprtolp

            ____________________________________________________________

            September 9,1993                -jst                          Page 4


                                      Silicon Graphics Technical Support
            ____________________________________________________________

            Configuring        for Lprtolp

            You        will need to  edit  the         /var/spool/lp/etc/lprtolp  file
            manually.  Please make sure        you format the lines correctly.
            The        first line of the file must begin with ``#!'',        followed
            by a single        space, followed        by /bin/sh.

                 #! /bin/sh
                 lp -s
            The        shell /bin/sh will be invoked when the filter is called.
            All        input to this filter will be sent to:
                 lp -s
            Other options may be appropriate for LP  depending        on  your
            particular printer type and        configuration.

            You        will also need to  set        permission  correctly  for  this
            script to execute:
                 #  chown  lp  /var/spool/lp/etc/lprtolp
                 #  chgrp  lp  /var/spool/lp/etc/lprtolp
                 #  chmod  755        /var/spool/lp/etc/lprtolp

            Configuring        for Remote Access
            Put        the hostname of        any systems that will want to  print  in
            your /etc/hosts.equiv file,        and verify that        their IP address
            and        hostname appear        in their  /etc/hosts  file.   They  will
            need  to  add  the        your  IP  address  and hostname        to their
            /etc/hosts file.

             Configuring the log file
            You        will need  to  make  a        log  file  and        set  permissions
            accordingly:
                 #  touch  /var/spool/lpd/lp-log
                 #  chmod  644        /var/spool/lpd/lp-log
                 #  chown  lp  /var/spool/lpd/lp-log
                 #  chgrp  lp  /var/spool/lpd/lp-log

            ____________________________________________________________

            September 9,1993                -jst                          Page 5


                                      Silicon Graphics Technical Support
            ____________________________________________________________

            Attempting to Print        Using the LPR command

            Now        that you have the /etc/printcap         file  configured,  make
            sure  that        the  daemon  is         running.   Enter  the following
            command:
                 #  ps        -ef  |        grep  lpd
            Your system        should return something        similar        to:
                 root        195    1   0   11:06:04          ?        0:00 /usr/etc/lpd
                 root  1293  753   2   13:20:39         ttyq6        0:00 grep lpd
            The        /usr/etc/lpd at        the end        of the lines indicates that  the
            daemon  is        running.   If you only got one line back (``grep
            lpd''), then start the lpd daemon by entering the  following
            command:
                 #  /usr/etc/lpd
            Now        if you do ``ps -ef | grep lpd''        you should see        2  lines
            returned to        you.
            From the configuration  pages,  note  that        the  printer  is
            accessed  by  the  name lp.         By default the        lpr command will
            look for the entry lp in the /etc/printcap file.

            Now        enter the command:
                 lpr  filename

            After submitting your request to the printer.  You        can  see
            if        your  job  has        made  it  to the print spooling        queue by
            entering the following command:
                 #  lpq
            Your system        should return something        similar        to:
                 lp is ready and printing
                 Rank  Owner  Job  Files         Total Size
                 1st        guest 113  filename         851 bytes

            ____________________________________________________________

            September 9,1993                -jst                          Page 6