\section{Upstart **}

\begin{frame}
   {Upstart}

   \begin{itemize}
      \item Event driven
      \item \filelink{/etc/inittab} supplies only runlevel
      \item Uses different configuration files:
      \begin{kcode}
/etc/init/rcS.conf
/etc/rc.sysinit
/etc/inittab
/etc/init/rc.conf
/etc/rc[0-5].d
/etc/init/start-ttys.conf
      \end{kcode}

   \end{itemize}

\end{frame}

\cprotect\note{

   \textbf{Upstart} is \textbf{event driven}, rather than
   being a set of serial procedures.  Event notifications
   are sent to the \textbf{init} process to tell it to
   execute certain commands at the right time after
   pre-requisites have been fulfilled.  Because
   \textbf{Upstart} is being superseded by
   \textbf{systemd}, we will not spend as much time on it or
   do exercises with it.

   When the kernel starts the \textbf{init} process, this
   causes the \texttt{rcS.conf} script to be executed.
   This, in turn, causes \texttt{rc.sysinit} to be run.

   \texttt{rc.sysinit} will do a number of tasks,
   including starting \textbf{LVM}, mounting filesystems,
   and then executing all of the runlevel scripts for the
   default runlevel specified in \filelink{/etc/inittab}.

   This is accomplished by executing \texttt{rc.conf} and
   passing it the runlevel. These runlevel scripts bring
   up the services on the system.
   Finally, additional scripts such as
   \texttt{start-ttys.conf} and \texttt{prefdm.conf} (for
   runlevel 5 only) are executed.


   Use of \filelink{/etc/inittab} is deprecated, and is
   now used only for setting up the default runlevel via
   the \texttt{initdefault} line. Other configuration is
   done via \textbf{Upstart} jobs in the \filelink{/etc/init}
   directory. Generally, \textbf{Upstart} events will be found in
   the \filelink{/etc/event.d} directory.

   For example, the number of active \texttt{tty} consoles
   is now set by the \verb?ACTIVE_CONSOLES? variable in
   \filelink{/etc/sysconfig/init}, which is read by the
   \filelink{/etc/init/start-ttys.conf} job. The default
   value is \verb?ACTIVE_CONSOLES=/dev/tty[1-6]?, which
   starts a \textbf{getty} process on \texttt{tty1} through
   \texttt{tty6}.

   While \textbf{Upstart} was included in \textbf{RHEL 6},
   \textbf{RHEL 7} uses \textbf{systemd} and
   \textbf{Ubuntu} is currently the only major
   \textbf{Linux} distribution using \textbf{Upstart}
   and has announced plans to move to \textbf{systemd}.
}

\begin{frame}
   {Upstart Utilities}

   \begin{itemize}
      \item \textbf{initctl} is used to view, start, and stop
      jobs
      \item Similar to \textbf{service}
      \item Syntax: \textbf{initctl [command]}
   \end{itemize}

\end{frame}

\cprotect\note{

   Using \textbf{initctl} you can view, start, stop jobs in
   much the same way that \textbf{service} does.  The
   syntax is:
   \begin{cmd}
$ initctl options command
   \end{cmd}

   where \texttt{options} can have the following values:
   \begin{itemize}
      \item \texttt{start}: Starts a job
      \item \texttt{stop}:  Stops a job
      \item \texttt{restart} Restarts a job
      \item \texttt{reload}  Sends \texttt{HUP} signal to a job
      \item \texttt{status}  Queries status of a job
      \item \texttt{list}    List known jobs
      \item \texttt{emit}    Emits an event
   \end{itemize}

   A good summary of how to use \textbf{initctl} and many other
   features of \textbf{Upstart} can be found at
   \url{http://upstart.ubuntu.com/cookbook}.

}


