\section{systemd}

\begin{frame}
   {systemd Features}
   \begin{itemize}
      \item Boots faster than previous init systems
      \item Provides aggressive parallelization capabilities
      \item Uses \textbf{socket} and \textbf{D-Bus} activation
      for starting services
      \item Replaces shell scripts with programs
      \item Offers on-demand starting of daemons
      \item Keeps track of processes using \textbf{cgroups}
      %%      \item Supports creating snapshots and restoring system state
      \item Maintains mount and automount points
      \item Implements an elaborate transactional
      dependency-based service control logic
      \item Can work as a drop-in replacement for
      \textbf{SysVinit} and is compatible with \textbf{SysVinit} scripts.
   \end{itemize}

\end{frame}

\cprotect\note{

   The \textbf{systemd} system and session manager for
   \textbf{Linux} is now dominant in all major
   distributions.

   Note that \textbf{systemd} is backward compatible with
   \textbf{SysVinit} and the concept of runlevels is
   supported via runlevel \textbf{targets}.  The
   \textbf{telinit} program is emulated to work with
   runlevels.

   Instead of \textbf{bash} scripts, \textbf{systemd} uses
   \file{.service} files.  In addition, \textbf{systemd}
   sorts all daemons into their own \textbf{Linux}
   \textbf{cgroups} (control groups).

}

\begin{frame}
   {systemd Configuration Files}

   \begin{itemize}
      \item
      \filelink{/etc/hostname} replaced:
      \begin{itemize}
         \item
         \filelink{/etc/sysconfig/network} in \textbf{Red Hat}-based systems
         \item
         \filelink{/etc/HOSTNAME} in \textbf{SUSE}-based systems
         \item
         \filelink{/etc/hostname} (was already adopted as the standard) in
         \textbf{Debian}-based systems.
      \end{itemize}
      \item
      Other files might include:
      \begin{itemize}
         \item \filelink{/etc/vconsole.conf}: default keyboard mapping
         and console font
         \item \filelink{/etc/sysctl.d/*.conf}: drop-in directory for
         kernel \textbf{sysctl} parameters
         \item \filelink{/etc/os-release}: distribution ID file
      \end{itemize}
   \end{itemize}

\end{frame}

\cprotect\note{

   Although \textbf{systemd} prefers to use a set of
   standardized configuration files, it can use
   distribution-dependent legacy configuration files as
   a fall-back.

   Exactly which configuration files will depend on how each
   distribution sets things up; for example, \file {/etc/vconsole.conf},
   which configures virtual terminal defaults, does not appear on
   \textbf{Ubuntu} systems.

   \begin{info}[Compatibility with SysVinit]

      \textbf{systemd} is configured to be mostly backward
      compatible with \textbf{SysVinit} so using old commands
      will generally work.

      It supports the use of runlevels conceptually, through
      the mechanism of runlevel \emph{targets}.  In addition,
      \textbf{telinit} is emulated to work with runlevels.

   \end{info}

}

\section{systemctl}
\begin{frame}
   {systemctl}

   \begin{cmd}
$ systemctl [options] command [name]
   \end{cmd}

   \begin{itemize}
      \item To show the status of everything \textbf{systemd} controls:
      \begin{cmd}
$ systemctl
      \end{cmd}
      \item Show all available services:
      \begin{cmd}
$  systemctl list-units -t service --all
      \end{cmd}
      \item  Show only active services:
      \begin{cmd}
$ systemctl list-units -t service
      \end{cmd}
      \item To start (activate) one or more \textbf{units}:
      \begin{cmd}
$ sudo systemctl start foo
$ sudo systemctl start foo.service
$ sudo systemctl start /path/to/foo.service
      \end{cmd}
      where a unit can be a service or a socket.
   \end{itemize}

\end{frame}

\cprotect\note {

   \textbf{systemctl} is the main utility for managing
   services.  Some \textbf{systemctl} commands can be
   run as non-root user, others require running as root or
   with \textbf{sudo}.

   For most commands you can omit the
   \texttt{.service} attached to the service name.

   For an excellent summary of how to go from
   \textbf{SysVinit} to \textbf{systemd}, see the
   \textbf{SysVinit to systemd Cheatsheet} at
   \url{https://fedoraproject.org/wiki/SysVinit_to_Systemd_Cheatsheet}.

}

\begin{frame}
   {systemctl (cont'd)}
   \begin{itemize}
      \item To stop (deactivate):
      \begin{cmd}
$ sudo systemctl stop foo.service
      \end{cmd}
      \item Enable/disable a service:
      \begin{cmd}
$ sudo systemctl enable sshd.service
$ sudo systemctl disable sshd.service
      \end{cmd}
      These commands do not actually start or stop
      a service; they control whether or not it is
      started up at system boot.
   \end{itemize}

\end{frame}

\cprotect\note
{
   For most commands you can omit the
   \texttt{.service} attached to the service name.

}


