\input{gl2.slide-header-beamer}%
\errorcontextlines=99
%% Subtopic Number = '1.107.4'
%% Title from filename: 'Install and configure local and remote printers'
%% Weight: 1
%% Description:
%% %% Key files, terms, and utilities include:
%%        /etc/printcap
%%        /etc/apsfilter/*
%%        /var/lib/apsfilter/*/
%%        /etc/magicfilter/*/
%%        /var/spool/lpd/*/
%%        lpd
\title{1.107.4\\Install and configure local and remote printers\\Weight 1}
\author[Andrew Eager]{Andrew Eager \texttt{<andrew.eager@aes-pl.com.au>}
  \and Geoff Robertson \texttt{<ge@ffrey.com>} \and Nick Urbanik \texttt{<nicku@nicku.org>}\\
  {\tiny This document Licensed under GPL---see section~\ref{sec:license}}}%
\subtitle{Linux Professional Institute Certification --- 102}%
\mode<article>{\chead{1.107.4}}


\begin{document}
\maketitle
\mode<article>{\thispagestyle{empty}}

\begin{frame}
  \frametitle{Outline}
  \mode<presentation>
  {%
    %\footnotesize
    \begin{multicols}{2}
      \tableofcontents
    \end{multicols}
    % You might wish to add the option [pausesections]
  }%
  \mode<article>
  {%
    \tableofcontents
  }%
\end{frame}

\section{Context}
\label{sec:context}

\begin{frame}
  \frametitle{Topic 107 Printing [3]}%
  \framesubtitle{Where we are up to}%
    \begin{description}
    \item[1.107.2] Manage printers and print queues [1]
    % \uline depends on \usepackage[normalem]{ulem}:
    \item[1.107.3] \textbf{\uline{Print files [1]}}
    \item[1.107.4] Install and configure local and remote printers [1]
    \end{description}
\end{frame}

%------------------------------------------------------------------------------

%----10->|-----20->|-----30->|-----40->|-----50->|-----60->|-----70->|-----80->
% \begin{frame}[fragile]
%  %================================================================
% \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  
% \end{frame}
%-----------------------------------------------------------
%----10->|-----20->|-----30->|-----40->|-----50->|-----60->|-----70->|-----80->

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

\section{Objective}
\label{sec:objective}

%==============================================================================
\begin{frame}[fragile]
  \frametitle{Description of Objective}%
  \framesubtitle{1.107.4\ \ Install and configure local and remote
    printers [1]}%
  \mode<presentation>{\Large}%
  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 postscript, non-postscript and samba
  printers.
\end{frame}
%-----------------------------------------------------------
 
%==============================================================================
\begin{frame}
  \frametitle{Key files, terms, and utilities include:}%
  \framesubtitle{1.107.4\ \ Install and configure local and remote
    printers [1]}%
  \mode<presentation>{\large}%
  \begin{description}
  \item[lpd] The Printing daemon
  \item[\texttt{/var/spool/lpd/*}] --- Spooler directories
  \item[\texttt{/etc/printcap}] --- \texttt{lpd} Configuration file
  \item[\texttt{/etc/apsfilter/*}]
  \item[\texttt{/var/lib/apsfilter/*}]
  \item[\texttt{/etc/magicfilter/*}]
  \end{description}
\end{frame}
%-----------------------------------------------------------


\section{Resources}
\label{sec:resources}

%==============================================================================
\begin{frame}
  \frametitle{Resources of interest}%
  \begin{description} 
  \item Printing-HOWTO
  \item Printing-Usage-HOWTO
  \item www.linuxprinting.org
  \end{description}
\end{frame}
%-----------------------------------------------------------

\section{Overview of Linux Printing}
\label{sec:overview}

\begin{frame}
  \frametitle{Linux Printing}
\begin{itemize}
\item There are several packages available for linux printing:
  \begin{itemize}
  \item LPR
  \item LPRng
  \item Cups
  \end{itemize}
\item Previously LPR (or LPRng) was the default on most Linux distros\ldots
\item \ldots\,but now Cups is the default.
\item Major components of the LPR subsystem are:
  \begin{itemize}
  \item \texttt{lpd} --- The printing daemon
  \item \texttt{\red{\textbf{lpr}}} --- A tool to submit jobs into the queue
  \item \texttt{\red{\textbf{lprm}}} --- A tool to remove jobs from the queue
  \item \texttt{\red{\textbf{lpq}}} --- A tool to view jobs in the queue
  \item \texttt{lpc} --- An administration tool for printers and queues
  \end{itemize}
\item The commands in \texttt{\red{\textbf{red}}} are also provided by
  Cups.
\end{itemize}
\end{frame}
%-----------------------------------------------------------

\section{Setting up a Printer}
\label{sec:setting-up-a-printer}


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

\begin{frame}
  \frametitle{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} or
    \texttt{system-config-printer} on Fedora systems.
  \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}
\end{frame}

%-----------------------------------------------------------

\section{\texttt{/etc/printcap} file}
\label{sec:printcap-file}


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

\begin{frame}[fragile]
  \frametitle{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}
\end{frame}

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

\subsection{printcap file syntax}
\label{sec:printcap-syntax}


\begin{frame}
  \frametitle{printcap --- The configuration file}
  \framesubtitle{Syntax}
  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 and log file need to be created manually
    \begin{itemize}
    \item it is not created automatically by LPD
    \end{itemize}
  \end{itemize}
\end{frame}

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


\begin{frame}
  \frametitle{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}
\end{frame}

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

\section[spool dir and log file]{Creating spool directory and log file}
\label{sec:creating-spool-and-log-files}


\begin{frame}
  \frametitle{Creating spool directory and log file}%
  The spool directory should be owned by user \texttt{lp} and have
  permissions set to 700:
  \begin{itemize}
  \item \cmd{sudo mkdir /var/spool/lpd/HPLjet}
  \item \cmd{sudo chown lp:lp /var/spool/lpd/HPLjet}
  \item \cmd{sudo chmod 0700 /var/spool/lpd/HPLjet}
  \end{itemize}
  The log file should have permissions set to 660 and have the same
  ownership as the spool directory:
  \begin{itemize}
  \item \cmd{sudo touch /var/spool/lpd/HPLjet/log}
  \item \cmd{sudo chown lp:lp /var/spool/lpd/HPLjet/log}
  \item \cmd{sudo chmod 0660 /var/spool/lpd/HPLjet/log}
  \end{itemize}
\end{frame}

\section{Access Control}
\label{sec:access-control}


\begin{frame}[fragile]
  \frametitle{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 \texttt{box2.c222}, only \texttt{greg} from
  \texttt{box3.c222}
\begin{semiverbatim}
box2.c222
box3.c222 greg
\end{semiverbatim}
\end{frame}

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

\section{Print Filters}
\label{sec:print-filters}


\begin{frame}
  \frametitle{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 Foomatic
    \item Apsfilter
    \item Magicfilter
    %\item Red Hat's PrintTool
    \end{itemize}
  \end{itemize}
\end{frame}

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

\begin{frame}[fragile]
  \frametitle{Key Point Summary}%
  \begin{itemize}
  \item Most Linux systems previously used LPR (or LPRng),
  \item but now most Linux systems use Cups
  \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}
\end{frame}

\begin{frame}
  \frametitle{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}
\end{frame}


\mode<presentation>
{%
\begin{frame}
  \frametitle{Topics Covered}
  %\footnotesize
  %\begin{multicols}{2}
    \tableofcontents[pausesections,pausesubsections]
  %\end{multicols}
  % You might wish to add the option [pausesections]
\end{frame}
}

\section{License of this document}
\label{sec:license}

%==============================================================================
\begin{frame}
  \frametitle{License Of This Document}%
  \raggedright%
  Copyright \copyright\ 2005, 2002 Andrew Eager
  <andrew.eager@aes-pl.com.au>, Geoffrey Robertson <ge@offry.com>,
  Nick Urbanik <nicku@nicku.org>.%
  \par
  You can redistribute modified or unmodified copies 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.
\end{frame}
\end{document}
