%% LyX 1.1 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[german,dvips]{slides}
\usepackage[T1]{fontenc}
\usepackage{geometry}
\geometry{verbose,landscape,letterpaper}
\usepackage{babel}
\IfFileExists{url.sty}{\usepackage{url}}
                      {\newcommand{\url}{\texttt}}

\makeatletter

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
\providecommand{\LyX}{L\kern-.1667em\lower.25em\hbox{Y}\kern-.125emX\@}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
 \newcounter{slidetype}
 \setcounter{slidetype}{0}
 \newif\ifLyXsNoCenter
 \LyXsNoCenterfalse
 \newcommand{\noslidecentering}{
    \LyXsNoCentertrue%
 }
 \newcommand{\slidecentering}{
    \LyXsNoCenterfalse%
 }
 \newcommand{\lyxendslide}[1]{
    \ifLyXsNoCenter%
         \vfill%
    \fi%
    \ifcase \value{slidetype}%
         \or % no action for 0
         \end{slide} \or%
         \end{overlay} \or%
         \end{note}%
    \fi%
    \setcounter{slidetype}{0}
\visible
 }
 \AtEndDocument{\lyxendslide{.}}
 \newcommand{\lyxnewslide}[1]{
    \lyxendslide{.}
    \setcounter{slidetype}{1}
    \begin{slide}
 }

\makeatother
\begin{document}
\vspace{20pt}

{\centering Systemdienste und Betriebssystemadministration\par}

\vspace{20pt}

{\centering \textbf{\large BSD Bootvorgang}\\
\textbf{\large init, runlevel, rc-Skripte}\large \par}

\vspace{20pt}

{\centering Stephan Uhlmann <su@su2.info>\\
05.07.2002\par}

\vfill

{\tiny Copyright 2002 Stephan Uhlmann}{\tiny \par}

{\tiny Permission is granted to copy, distribute and/or modify this
document under the terms of the GNU Free Documentation License, Version
1.1 or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts and no Back-Cover
Texts. A copy of the license can be obtained from \url{http://www.gnu.org/licenses/fdl.html}.}{\tiny \par}


\lyxnewslide{betrachtete Betriebssysteme}

Betrachtete Betriebssysteme

\begin{enumerate}
\item FreeBSD 4.5
\item NetBSD 1.5.2
\item MacOS X 10.1.3
\end{enumerate}

\lyxnewslide{Gemeinsamkeiten}

Gemeinsamkeiten

\begin{itemize}
\item nur einen Haupt-Runlevel: Multi-User
\item /sbin/init erster Prozess
\item /etc/rc verantwortlich für die Bootskripte
\item /etc/ttys für die Terminals\\
(== /etc/inittab in System V)
\end{itemize}

\lyxnewslide{Bootvorgang}

Bootvorgang

\begin{enumerate}
\item Kernel startet /sbin/init als ersten Prozess
\item init: Kernel Security-Level +1 (0->1 (secure))
\item /etc/rc wird ausgeführt -> Bootskripte

\begin{enumerate}
\item OK: Multi-User -> /etc/ttys\\
- Terminals: /usr/libexec/getty\\
- beliebige Daemons
\item FAIL: Single-User\\
- root Shell -> \textasciicircum{}D: Multi-User\\
- tty 'insecure' (/etc/ttys) -> root Passwort
\end{enumerate}
\end{enumerate}

\lyxnewslide{FreeBSD (1)}

FreeBSD

\begin{itemize}
\item /etc/defaults/rc.conf - Standardeinstellungen
\item /etc/rc.conf - systemspezifische Einstellungen
\item /etc/rc.network, /etc/rc.firewall, ..., /etc/rc.local
\item local\_startup=''/usr/local/etc/rc.d\\
/usr/X11R6/etc/rc.d''
\item /etc/rc:\\
for script in \$\{dir\}/{*}.sh; do\\
\$\{script\} start
\end{itemize}

\lyxnewslide{FreeBSD (2)}

FreeBSD

\begin{itemize}
\item bei reboot/halt: /etc/rc.shutdown\\
führt {}``\$\{script\} stop'' in umgekehrter Reihenfolge aus
\item Signale an init (kill -s SIGNAL 1):

\begin{enumerate}
\item USR\{1,2\} / init 0 : Halt (+ power off)
\item TERM / init 1 : Single-User
\item INT / init 6 : Reboot
\item TSTP / init c : keine neuen Prozesse
\item HUP / init q : /etc/ttys neu einlesen
\end{enumerate}
\end{itemize}

\lyxnewslide{NetBSD (1)}

NetBSD

\begin{itemize}
\item /etc/defaults/rc.conf - Standardeinstellungen
\item /etc/rc.conf - systemspezifische Einstellungen
\item /etc/rc.d/{*} - Startskripte
\item {}``rcorder'' löst Abhängigkeiten auf\\
dazu: PROVIDE, REQUIRE, BEFORE keywords im Header
\item Bsp:\\
\texttt{\footnotesize ...}~\\
\texttt{\footnotesize \# PROVIDE: nfsd}~\\
\texttt{\footnotesize \# REQUIRE: mountd}~\\
\texttt{\footnotesize . /etc/rc.subr}~\\
\texttt{\footnotesize ...}{\footnotesize \par}
\end{itemize}

\lyxnewslide{NetBSD (2)}

NetBSD

\begin{itemize}
\item /etc/rc.shutdown
\item Signale an init:

\begin{enumerate}
\item init -s : Single User
\item init
\item kill -s HUP 1 : /etc/ttys neu einlesen
\item kill -s TERM 1 : halt
\end{enumerate}
\end{itemize}

\lyxnewslide{MacOS X (1)}

MacOS X

\begin{itemize}
\item /etc/rc -> /etc/rc.common (Funktionen \& wichtige Einstellungen)
\item /etc/hostconfig - durch Tools editierbar
\item /sbin/SystemStarter
\item -> /system/Library/StartupItems/{*}/

\begin{enumerate}
\item Resources/
\item StartupParameters.plist
\item Script
\end{enumerate}
\end{itemize}

\lyxnewslide{MacOS X (2)}

StartupParameters.plist:

\texttt{\footnotesize \{}{\footnotesize \par}

\texttt{\footnotesize ~ Description~~~~ = \char`\"{}Sun network
file system\char`\"{};}{\footnotesize \par}

\texttt{\footnotesize ~ Provides~~~~~~~ = (\char`\"{}NFS\char`\"{});}{\footnotesize \par}

\texttt{\footnotesize ~ Requires~~~~~~~ = (\char`\"{}Portmap\char`\"{},
\char`\"{}Resolver\char`\"{});}{\footnotesize \par}

\texttt{\footnotesize ~ OrderPreference = \char`\"{}None\char`\"{};}{\footnotesize \par}

\texttt{\footnotesize ~ Messages =}{\footnotesize \par}

\texttt{\footnotesize ~ \{}{\footnotesize \par}

\texttt{\footnotesize ~~~ start = \char`\"{}Starting network file
system\char`\"{};}{\footnotesize \par}

\texttt{\footnotesize ~~~ stop~ = \char`\"{}Stopping network file
system\char`\"{};}{\footnotesize \par}

\texttt{\footnotesize ~ \};}{\footnotesize \par}

\texttt{\footnotesize \}}{\footnotesize \par}


\lyxnewslide{MacOS X (3)}

MacOS X

\begin{itemize}
\item Signale an init:

\begin{enumerate}
\item kill -s TSTP 1 : keine neuen Prozesse
\item kill -s TERM 1 : Single User
\end{enumerate}
\end{itemize}

\lyxnewslide{Literatur}

Literatur

\begin{itemize}
\item man init, man rc
\item FreeBSD Bootvorgang: \url{http://www.freebsd.org/de/handbook/boot.html}
\item MacOS X Bootvorgang: \url{http://www.mac-club.de/tip_Trick/MacOSX/macostipps/KnowHow/knowhow-macosxboot.html}\end{itemize}

\end{document}

