\section{sysctl}

\begin{frame}
   {sysctl}

   \begin{itemize}
      \item Settings in \filelink{/proc/sys} can be
      manipulated with \textbf{sysctl}
      \item Variable names correspond to paths in
      \filelink{/proc/sys}
      \item Can view, set, or change kernel parameters
   \end{itemize}
   \begin{figure}[H]
      \includegraphics[height=2.5in]{IMAGES/sysctl}
      \caption{sysctl}
   \end{figure}

\end{frame}

\cprotect\note{

   The \textbf{sysctl} interface can be used to read and tune
   kernel parameters at run time. Current values can be
   displayed by doing:
   \begin{cmd}
$ sysctl -a
   \end{cmd}

   The following two statements are equivalent:

   \begin{cmd}
$ sudo sh -c 'echo 1 > /proc/sys/net/ipv4/ip_forward'
$ sudo sysctl net.ipv4.ip_forward=1
   \end{cmd}
   (Do not leave spaces around the \texttt{=} sign.) Note in the
   first form, we can not just use a simple \textbf{sudo} with
   \textbf{echo}; the command must be done in the complicated
   way shown, or executed as root.

   If settings are placed in \filelink{/etc/sysctl.conf}
   settings can be fixed at boot time.  Note that typing:
   \begin{cmd}
$ sudo sysctl -p
   \end{cmd}
   effectuates immediate digestion of the file, setting all
   parameters as found; this is also part of the boot process.

   \begin{info}[\texttt{/usr/lib/sysctl.d} and \texttt{/usr/lib/sysctl.d}]
      With the advent of \textbf{systemd}, things are a
      little more complicated.  Vendors put their settings in
      files the \filelink{/usr/lib/sysctl.d/} directory.
      These can be added to or supplanted by files placed in
      \filelink{/etc/sysctl.d}.  However, the original file
      (\filelink{/etc/sysctl.conf}) is still supported as is
      self-documented in that file.
   \end{info}

}

