%% $Header: /cvsroot/lcdp/lpic/general-linux-2/slides/gl2.107.4.slides.tex,v 1.2 2003/08/20 14:15:43 geoffr Exp $


\input{gl2.slide-header.tex}
\usepackage{epsfig}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%==============================================================================
%\begin{slide} %ghr
%  \listofslides
%\vfill \end{slide}
%------------------------------------------------------------------------------

%----10->|-----20->|-----30->|-----40->|-----50->|-----60->|-----70->|-----80->
\begin{slide} %================================================================
\begin{center} \LARGE \textsf{-- General Linux 2 -- \\
Install \& configure local \& remote printers} \\[2mm]
\large  \textsf{(Linux Professional Institute Certification)}\\[1mm]

\normalsize\end{center}

\footnote{Copyright \copyright\ 2002 Geoffrey Robertson. Permission is granted to make and distribute verbatim copies or modified versions of this document provided that this copyright notice and this permission notice are preserved on all copies under the terms of the GNU General Public License as published by the Free Software Foundation---either version 2 of the License or (at your option) any later version.}
 
\scriptsize
\begin{verbatim} 
   .~.         Presentation by Andrew Eager
   /V\         geoffrey robertson        
  // \\        geoffrey@zip.com.au
  @._.@ 
\end{verbatim} 
\tiny
\begin{verbatim}
$Id: gl2.107.4.slides.tex,v 1.2 2003/08/20 14:15:43 geoffr Exp $ %$
\end{verbatim} 
\normalsize  
\vfill \end{slide} %-----------------------------------------------------------
%----10->|-----20->|-----30->|-----40->|-----50->|-----60->|-----70->|-----80->

%==============================================================================
%==============================================================================
\begin{slide} %ghr 
  \slideheading{Install \& configure local \& remote printers}
  \begin{description}
  \item[1.107.2] Manage printers \& print queues
  \item[1.107.3] Print files
  \item[1.107.4] \bf{ \underline{Install \& configure local \& remote printers}}
\end{description}
\vfill \end{slide} %-----------------------------------------------------------
  

%==============================================================================
%==============================================================================
\begin{slide} %AE
\slideheading{Install \& configure local \& remote printers}
\slidesubheading{Objective} 

Candidates should be able to install a printer daemon, install and configure a print filter (eg apsfilter, magicfilter).  This objective includes making local and remote printers accessible for a linux system, including postrscript, non-postscript and samba printers. 
\vfill \end{slide} %-----------------------------------------------------------
 
%==============================================================================
\begin{slide} %AE
\slideheading{Install \& configure local \& remote printers}
\slidesubheading{Key files, terms, and utilities}
\begin{description}
\item[lpd] The Printing daemon
\item[\texttt{/var/spool/lpd/*}] - Spooler directories
\item[\texttt{/etc/printcap}] - Configuration file
\item[\texttt{/etc/apsfilter/*}]
\item[\texttt{/var/lib/apsfilter/*}]
\item[\texttt{/etc/magicfilter/*}]
\end{description}
\vfill \end{slide} %-----------------------------------------------------------
 
%==============================================================================
\begin{slide} %AE
  \slideheading{}
  \slidesubheading{Resources of interest}
  \begin{description} 
  \item Printing-HOWTO
  \item Printing-Usage-HOWTO
  \item www.linuxprinting.org
  \end{description}
  \vfill \end{slide} %-----------------------------------------------------------
 
%==============================================================================
%\begin{slide}{} %ghr
%\Slidecontents
%\vfill \end{slide} %-----------------------------------------------------------


%==============================================================================

\begin{slide}{} %Andrew Eagere
  \slideheading{Linux Printing}
\begin{itemize}
\item There are several packages available for linux printing:
  \begin{itemize}
  \item LPR
  \item LPRng
  \item Cups
  \end{itemize}
\item LPR (or LPRng) is the default on most Linux distros
\item Major components of the LPR subsystem are:
  \begin{itemize}
  \item lpd - The printing daemon
  \item lpr - A tool to submit jobs into the queue
  \item lprm - A tool to remove jobs from the queue
  \item lpq - A tool to view jobs in the queue
  \item lpc - An administration tool for printers \& queues
  \end{itemize}
\end{itemize}
\vfill \end{slide} %-----------------------------------------------------------
 
%==============================================================================

\begin{slide}{} %Andrew Eager
  \slideheading{Installing a Printer}
\begin{itemize}
\item There are two ways to install a printer under Linux:
\item The easy way! - Use a GUI like \texttt{printtool}
\item The hard way:
\begin{itemize}
\item Edit \texttt{/etc/printcap}
\item Create the spool directory
\item Touch the log file
\item Restart lpd
\end{itemize}
\end{itemize}

\vfill \end{slide} %-----------------------------------------------------------
 
%==============================================================================

\begin{slide}{} %Andrew Eager
  \slideheading{printcap - The configuration file}

\texttt{/etc/printcap} contains information about {\bf all} printers on the system (including remote printers)

An example looks like:

\begin{verbatim}
HPLjet|lp|lp0:\
        :ml=0:\
        :mx=0:\
        :sd=/var/spool/lpd/HPLjet:\
        :sh:\
        :lp=/dev/lp0:\
        :lf=/var/spool/lpd/HPLjet/log:\
        :if=/usr/share/printconf/util/mf_wrapper:
\end{verbatim}

\vfill \end{slide}

%==============================================================================

\begin{slide}{} %Andrew Eager
  \slideheading{printcap - The configuration file}
Key points to note about \texttt{printcap} format:
\begin{itemize}
\item Comments start with a '\#'
\item Any line not starting with a colon or pipe is the start of a printer definition
\item Each line of a definition ends in a backslash except the last line
\item lpd must be restarted each time \texttt{/etc/printcap} is edited 
\item Spool directory \& log file must be created manually
\end{itemize}

\vfill \end{slide}

%==============================================================================

\begin{slide}{} %Andrew Eager
  \slideheading{printcap - The configuration file}
\begin{description}
\item[if] Define the input filter
\item[lf] Define the printer log file
\item[lo] Define the lock file created when printer is in use
\item[mx] Define the maximum size of a print job
\item[rm] Specify printer is on remote machine. Eg \texttt{:rm=192.168.222.254:}
\item[rp] Define remote printer name. Eg \texttt{:rp=HPLjet:}
\item[sh] Tell lpd not to print banner pages
\item[sd] Specify spool directory 
\end{description}
\vfill \end{slide}

%==============================================================================

\begin{slide}{} %Andrew Eager
  \slideheading{Creating spool directory \& log file}
The spool directory should be owned by \texttt{lp} and have permissions set to 700:
\begin{itemize}
\item \rootcmd{mkdir /var/spool/lpd/HPLjet}
\item \rootcmd{chown lp:lp /var/spool/lpd/HPLjet}
\item \rootcmd{chmod 0700 /var/spool/lpd/HPLjet}
\end{itemize}

The log file should have permissions set to 666 and have the same ownership as the spool directory:
\begin{itemize}
\item \rootcmd{touch /var/spool/lpd/HPLjet/log}
\item \rootcmd{chown lp:lp /var/spool/lpd/HPLjet/log}
\item \rootcmd{chmod 0660 /var/spool/lpd/HPLjet/log}
\end{itemize}

\vfill \end{slide}

%==============================================================================

\begin{slide}{} %Andrew Eager
  \slideheading{Controlling printer access}
\begin{itemize}
\item Printer access is controlled through \texttt{/etc/hosts.lpd}
\item If the file does not exist, all access is granted
\item If the file exists, only those in the list will be granted access
\item The format is: \texttt{[host [user]]}
\end{itemize}

Example: All access from box2.c222, only greg from box3.c222

\begin{alltt}
box2.c222
box3.c222 greg
\end{alltt}

\vfill \end{slide}

%==============================================================================

\begin{slide}{} %Andrew Eager
  \slideheading{Print Filters}
  \begin{itemize}
  \item A print filter converts data to be printed into a language that your printer understands
  \item There are several print filter packages:
    \begin{itemize}
    \item Apsfilter
    \item Magicfilter
    \item Red Hat's PrintTool
    \item Foomatic
    \end{itemize}
  \end{itemize}
  \vfill \end{slide}

%==============================================================================

\begin{slide}{} %Andrew Eager
  \slideheading{Key Point Summary}
\begin{itemize}
\item Most Linux Systems use LPR (or LPRng)
\item Local \& remote printer configs are stored in \texttt{/etc/printcap}
\item The print spool directory \& log file must be created manually
\item Print access is controlled using \texttt{/etc/hosts.lpd}
\item Print filters convert different data types to a language understood by the printer
\item The \texttt{lpd} daemon is responsible for getting jobs from the user, putting them through the filter and delivering them to the spool directory.
\end{itemize}
\vfill \end{slide}

%==============================================================================

\begin{slide}{} %Andrew Eager
  \slideheading{Key Point Summary}
\begin{itemize}
\item The \texttt{lpc} program is used to control the printer and print spools
\item The \texttt{lpq} program is used to view the print queues
\item The \texttt{lprm} program is used to remove jobs from the queues
\item The \texttt{lpr} program is used to submit jobs into the queue.
\end{itemize}
\vfill \end{slide}

%==============================================================================
%==============================================================================
%==============================================================================
\end{document}
%==============================================================================

