8
This commit is contained in:
parent
57c5474434
commit
c17a7e3b42
3
7.html
3
7.html
@ -222,6 +222,9 @@ drwxrwxrwt 18 root root 114688 Jan 16 20:29 /tmp//</code></pre>
|
|||||||
</aside>
|
</aside>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
<section>
|
||||||
|
<span style="color: orange">Aufgabe:</span> Erstellt ein neues Verzeichnis "test". In diesem Verzeichnis eine Datei <code>foo.bar</code>. Ändert den Besitzer des Verz. auf root. Entzieht dem Verzeichnis die Leserechte für alle ausser den Besitzer. Versucht die Datei zu löschen.
|
||||||
|
</section>
|
||||||
<section data-transition="slide" data-background="#4d7e65" data-background-transition="convex">
|
<section data-transition="slide" data-background="#4d7e65" data-background-transition="convex">
|
||||||
<h2>Part 1 - Benutzerverwaltung </h2>
|
<h2>Part 1 - Benutzerverwaltung </h2>
|
||||||
</section>
|
</section>
|
||||||
|
303
8.html
303
8.html
@ -28,10 +28,12 @@
|
|||||||
link.href = window.location.search.match( /print-pdf/gi ) ? 'css/print/pdf.css' : 'css/print/paper.css';
|
link.href = window.location.search.match( /print-pdf/gi ) ? 'css/print/pdf.css' : 'css/print/paper.css';
|
||||||
document.getElementsByTagName( 'head' )[0].appendChild( link );
|
document.getElementsByTagName( 'head' )[0].appendChild( link );
|
||||||
</script>
|
</script>
|
||||||
|
<style type="text/css">
|
||||||
|
.reveal img{ max-height: 60vh}
|
||||||
|
</style>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div class="reveal">
|
<div class="reveal">
|
||||||
<!-- Any section element inside of this container is displayed as a slide -->
|
<!-- Any section element inside of this container is displayed as a slide -->
|
||||||
@ -40,7 +42,7 @@
|
|||||||
<section data-transition="slide" data-background="#4d7e65" data-background-transition="zoom">
|
<section data-transition="slide" data-background="#4d7e65" data-background-transition="zoom">
|
||||||
<h1>LINUX</h1>
|
<h1>LINUX</h1>
|
||||||
<h3>Das universelle Betriebssystem</h3>
|
<h3>Das universelle Betriebssystem</h3>
|
||||||
<p>Eine Einführung - Teil 7
|
<p>Eine Einführung - Teil 8
|
||||||
<p>
|
<p>
|
||||||
<small>Deutsche Angestellten Akademie</small>
|
<small>Deutsche Angestellten Akademie</small>
|
||||||
</p>
|
</p>
|
||||||
@ -51,50 +53,293 @@
|
|||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section data-transition="slide" data-background="lightblue" data-background-transition="zoom">
|
<section data-transition="slide" data-background="lightblue" data-background-transition="zoom">
|
||||||
<h2 style="text-shadow: 5px 4px 15px black;">Einstieg in die Systemverwaltung</h2>
|
<h2 style="text-shadow: 5px 4px 15px black;">Systemverwaltung</h2>
|
||||||
|
</section>
|
||||||
|
<section>
|
||||||
|
Begriff: daemon
|
||||||
|
|
||||||
|
<p>Ein Systemdienst der automatisch startet und ohne Eingriffe arbeitet ( meistens :-) )
|
||||||
|
<p>vgl. Dienste unter Windows
|
||||||
|
<p>Name endet oft mit „d“
|
||||||
|
<ul>
|
||||||
|
<li>systemd - ...
|
||||||
|
<li>sshd - SSH Server Daemon
|
||||||
|
<li>dockerd - docker daemon
|
||||||
|
<li>smbd - SAMBA File Server
|
||||||
|
<li>ntpd - Network Time Protocal Daemon
|
||||||
|
<li>atd - at Daemon
|
||||||
|
</section>
|
||||||
|
<section style="">
|
||||||
|
|
||||||
|
<p>Begriff: Runlevel</p>
|
||||||
|
|
||||||
|
<table class="prettytable" style=" font-size: .4em; border:solid 2px #677089;">
|
||||||
|
|
||||||
|
<tbody><tr style="">
|
||||||
|
<th style="line-height:2.5em;">Runlevel</th>
|
||||||
|
<th>Beschreibung
|
||||||
|
</th></tr>
|
||||||
|
<tr style="border-bottom:solid 2px #AAAAAA;">
|
||||||
|
<td style="text-align:center;font-weight:bold;">0
|
||||||
|
</td>
|
||||||
|
<td style="padding:4px 8px;line-height:118%;">Shutdown. Alle Netzverbindungen werden geschlossen, Dateipuffer werden geschrieben, Mounts auf Partitionen werden entfernt (d. h. die im Verzeichnisbaum eingebundenen Datenträger werden ausgehängt).
|
||||||
|
</td></tr>
|
||||||
|
<tr style="border-bottom:solid 2px #AAAAAA;">
|
||||||
|
<td style="text-align:center;font-weight:bold;">S
|
||||||
|
</td>
|
||||||
|
<td style="padding:4px 8px;line-height:118%;">Single-User-Runlevel; niedrigster Systemzustand für Wartungsarbeiten, in dem ausschließlich Systemressourcen wie <a href="/wiki/Festplatten" class="mw-redirect" title="Festplatten">Festplatten</a> oder <a href="/wiki/Dateisystem" title="Dateisystem">Dateisysteme</a> aktiv sind.
|
||||||
|
</td></tr>
|
||||||
|
<tr style="border-bottom:solid 2px #AAAAAA;">
|
||||||
|
<td style="text-align:center;font-weight:bold;">1
|
||||||
|
</td>
|
||||||
|
<td style="padding:4px 8px;line-height:118%;">Einzelnutzerbetrieb ohne Netzwerk mit ausschließlich lokalen Ressourcen. In vielen Implementierungen identisch mit 'S'.
|
||||||
|
</td></tr>
|
||||||
|
<tr style="border-bottom:solid 2px #AAAAAA;">
|
||||||
|
<td style="text-align:center;font-weight:bold;">2
|
||||||
|
</td>
|
||||||
|
<td style="padding:4px 8px;line-height:118%;">Lokaler Mehrnutzerbetrieb ohne Netzwerk mit ausschließlich lokalen Ressourcen. Unter einigen Linuxdistributionen (z. B. Debian) wird in Runlevel 2 auch das Netzwerk konfiguriert.
|
||||||
|
</td></tr>
|
||||||
|
<tr style="border-bottom:solid 2px #AAAAAA;">
|
||||||
|
<td style="text-align:center;font-weight:bold;">3
|
||||||
|
</td>
|
||||||
|
<td style="padding:4px 8px;line-height:118%;">Netzwerkbetrieb, über das Netzwerk erreichbare Ressourcen sind nutzbar, eine grafische Oberfläche steht nicht zur Verfügung. Firewalls sollten aktiviert werden.
|
||||||
|
</td></tr>
|
||||||
|
<tr style="border-bottom:solid 2px #AAAAAA;">
|
||||||
|
<td style="text-align:center;font-weight:bold;">4
|
||||||
|
</td>
|
||||||
|
<td style="padding:4px 8px;line-height:118%;">Ist normalerweise nicht definiert. Kann aber für diverse Dienste genutzt werden.
|
||||||
|
</td></tr>
|
||||||
|
<tr style="border-bottom:solid 2px #AAAAAA;">
|
||||||
|
<td style="text-align:center;font-weight:bold;">5
|
||||||
|
</td>
|
||||||
|
<td style="padding:4px 8px;line-height:118%;">Wie 3, zusätzlich wird die grafische Oberfläche bereitgestellt.
|
||||||
|
</td></tr>
|
||||||
|
<tr>
|
||||||
|
<td style="text-align:center;font-weight:bold;">6
|
||||||
|
</td>
|
||||||
|
<td style="padding:4px 8px;line-height:118%;">Reboot. Alle Netzverbindungen werden geschlossen, Dateipuffer werden geschrieben, Mounts auf Partitionen werden entfernt.
|
||||||
|
</td></tr></tbody></table>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section data-transition="slide" data-background="#4d7e65" data-background-transition="convex">
|
||||||
|
<h2>Part 5 - systemd</h2>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
|
||||||
|
<section>
|
||||||
|
<ul>
|
||||||
|
<li class="">Relativ neu
|
||||||
|
<li class="fragment">bricht mit alter Linux Philosophie:<br> -- do one thing and do it well --
|
||||||
|
<li class="fragment">Sysvinit funktioniert über Shell Scripte, die nacheinander abgearbeitet werden
|
||||||
|
<li class="fragment">Systemd ist schneller - startet Dienste parallel
|
||||||
|
<li class="fragment">Kritik : übernimmt sehr viel Kontrolle - single point of failure
|
||||||
|
<li class="fragment">zB Gnome3 ist abhängig von systemd
|
||||||
|
<li class="fragment">-->Abspaltungen: Devuan - nutzt weiterhin Sysvinit
|
||||||
|
<li class="fragment">Standard in : Debian RedHat Suse Ubuntu
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section>
|
||||||
|
|
||||||
|
<p>systemd ist organisiert mit
|
||||||
|
<ul>
|
||||||
|
<li class="fragment">units - einzelne Dienste
|
||||||
|
<li class="fragment">targets - Gruppen von Diensten, Systemzustände
|
||||||
|
<ul><li>entspr. runlevel unter Sysvinit</li></ul>
|
||||||
|
</ul>
|
||||||
|
<p>
|
||||||
|
<div class="fragment">
|
||||||
|
Dateien:
|
||||||
|
<p>/lib/systemd/system/ -> default
|
||||||
|
<p>/etc/systemd/system/ -> custom
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section>
|
||||||
|
<h3>Informationen anzeigen</h3>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li class="fragment ">Systemstatus anzeigen:<pre><code>systemctl status</code></pre></li>
|
||||||
|
<li class="fragment ">Liste der fehlgeschlagenene Units <pre><code>systemctl --failed</code></pre></li>
|
||||||
|
<li class="fragment ">Liste aller installierter Units<pre><code>systemctl list-unit-files</code></pre></li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section>
|
||||||
|
<h3>Dienste Steuern</h3>
|
||||||
|
<ul>
|
||||||
|
<li class="fragment ">Laufende Dienste anzeigen:<pre><code>systemctl</code></pre></li>
|
||||||
|
<li class="fragment ">Eine Unit starten <pre><code>systemctl start DIENST</code></pre></li>
|
||||||
|
<li class="fragment ">Eine Unit neu starten<pre><code>systemctl restart DIENST</code></pre></li>
|
||||||
|
<li class="fragment ">Unit Status anzeigen<pre><code>systemctl status DIENST</code></pre></li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section>
|
||||||
|
<ul>
|
||||||
|
<li class="fragment ">Dienst Autostart anschalten<pre><code>systemctl enable DIENST</code></pre></li>
|
||||||
|
<li class="fragment ">Dienst Autostart anschalten und sofort starten<pre><code>systemctl enable --now DIENST</code></pre></li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
|
||||||
|
<section>
|
||||||
|
<h3>Eine unit</h3>
|
||||||
|
<pre style="font-size: .4em"><code>[Unit]
|
||||||
|
Description=OpenBSD Secure Shell server
|
||||||
|
After=network.target auditd.service
|
||||||
|
ConditionPathExists=!/etc/ssh/sshd_not_to_be_run
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
EnvironmentFile=-/etc/default/ssh
|
||||||
|
ExecStartPre=/usr/sbin/sshd -t
|
||||||
|
ExecStart=/usr/sbin/sshd -D $SSHD_OPTS
|
||||||
|
ExecReload=/usr/sbin/sshd -t
|
||||||
|
ExecReload=/bin/kill -HUP $MAINPID
|
||||||
|
KillMode=process
|
||||||
|
Restart=on-failure
|
||||||
|
RestartPreventExitStatus=255
|
||||||
|
Type=notify
|
||||||
|
RuntimeDirectory=sshd
|
||||||
|
RuntimeDirectoryMode=0755
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
Alias=sshd.service
|
||||||
|
</code></pre>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
|
||||||
|
<section>
|
||||||
|
<span style="color: orange">Aufgabe:</span> Erstellt eine Unit und startet sie.
|
||||||
|
<div class="fragment">
|
||||||
|
<code style="font-size: .5em">/etc/systemd/system/simple-webserver.service</code>
|
||||||
|
<pre><code>[Unit]
|
||||||
|
Description=Simple Web Server
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
ExecStart=/home/USERNAME-HIER-EINSETZEN/hello-web.sh
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
|
||||||
|
</code></pre>
|
||||||
|
<code style="font-size: .5em">~/hello-web.sh</code>
|
||||||
|
<pre><code>#!/bin/bash
|
||||||
|
cd /home/
|
||||||
|
python3 -m http.server 8082 </code></pre>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</section>
|
||||||
|
|
||||||
|
|
||||||
|
<section>
|
||||||
|
<pre><code>systemctl start simple-webserver.service</code></pre>
|
||||||
|
<pre><code>systemctl status simple-webserver.service</code></pre>
|
||||||
|
Wenn das gescheitert sein sollte:
|
||||||
|
<pre><code>journalctl -xe </code></pre>
|
||||||
|
<pre><code>journalctl --unit=simple-webserver.service </code></pre>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section>Browser öffnen: <code>http://localhost:8082/BENUTZERNAME</code></section>
|
||||||
|
|
||||||
|
<section><h4>Ändern der Standard-Units</h4>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li class="fragment "> <pre><code>systemctl edit unit</code></pre></li>
|
||||||
|
<li class="fragment "> Öffnet <code>/etc/systemd/system/unit.d/override.conf</code></li>
|
||||||
|
<li class="fragment ">UnDo: <pre><code>systemctl revert unit</code></pre></li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section>
|
||||||
|
<h4>Ensprechenungen der alten Runlevel und der neuen Targets</h4>
|
||||||
|
|
||||||
|
<table class="wikitable" style="font-size:.4em">
|
||||||
|
<tbody><tr>
|
||||||
|
<th>SysV Runlevel</th>
|
||||||
|
<th>systemd Target</th>
|
||||||
|
<th>Notes
|
||||||
|
</th></tr>
|
||||||
|
<tr>
|
||||||
|
<td>0</td>
|
||||||
|
<td>runlevel0.target, poweroff.target</td>
|
||||||
|
<td>Halt the system.
|
||||||
|
</td></tr>
|
||||||
|
<tr>
|
||||||
|
<td>1, s, single</td>
|
||||||
|
<td>runlevel1.target, rescue.target</td>
|
||||||
|
<td>Single user mode.
|
||||||
|
</td></tr>
|
||||||
|
<tr>
|
||||||
|
<td>2, 4</td>
|
||||||
|
<td>runlevel2.target, runlevel4.target, multi-user.target</td>
|
||||||
|
<td>User-defined/Site-specific runlevels. By default, identical to 3.
|
||||||
|
</td></tr>
|
||||||
|
<tr>
|
||||||
|
<td>3</td>
|
||||||
|
<td>runlevel3.target, multi-user.target</td>
|
||||||
|
<td>Multi-user, non-graphical. Users can usually login via multiple consoles or via the network.
|
||||||
|
</td></tr>
|
||||||
|
<tr>
|
||||||
|
<td>5</td>
|
||||||
|
<td>runlevel5.target, graphical.target</td>
|
||||||
|
<td>Multi-user, graphical. Usually has all the services of runlevel 3 plus a graphical login.
|
||||||
|
</td></tr>
|
||||||
|
<tr>
|
||||||
|
<td>6</td>
|
||||||
|
<td>runlevel6.target, reboot.target</td>
|
||||||
|
<td>Reboot
|
||||||
|
</td></tr>
|
||||||
|
<tr>
|
||||||
|
<td>emergency</td>
|
||||||
|
<td>emergency.target</td>
|
||||||
|
<td>Emergency shell
|
||||||
|
</td></tr>
|
||||||
|
</tbody></table>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section>
|
||||||
|
Ausserdem:
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li class="fragment ">mount -> systemd kann Dateisysteme mounten</li>
|
||||||
|
<li class="fragment ">timer -> systemd kann cron ersetzen</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
|
||||||
|
<section>
|
||||||
|
<h4>journalctl</h4>
|
||||||
|
Das logging system moderner Linux Distributionen.
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section>
|
||||||
|
<h4>systemctl</h4>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
|
||||||
<section data-transition="slide" data-background="#4d7e65" data-background-transition="convex">
|
<section data-transition="slide" data-background="#4d7e65" data-background-transition="convex">
|
||||||
<h2>Part 3 - daemons</h2>
|
<h2>Part 5 - daemons</h2>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section data-transition="slide" data-background="#4d7e65" data-background-transition="convex">
|
<section data-transition="slide" data-background="#4d7e65" data-background-transition="convex">
|
||||||
<h2>Part 4 - Uhrzeit und Datum</h2>
|
<h2>Part 6 - Uhrzeit und Datum</h2>
|
||||||
</section>
|
|
||||||
|
|
||||||
<section data-transition="slide" data-background="#4d7e65" data-background-transition="convex">
|
|
||||||
<h2>Part 5 - Zeitgesteuerte Jobs</h2>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<section data-transition="slide" data-background="#4d7e65" data-background-transition="convex">
|
|
||||||
<h2>Part 6 - Cron</h2>
|
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section data-transition="slide" data-background="#4d7e65" data-background-transition="convex">
|
<section data-transition="slide" data-background="#4d7e65" data-background-transition="convex">
|
||||||
<h2>Part 7 - Startup / Shutdown</h2>
|
<h2>Part 7 - Startup / Shutdown</h2>
|
||||||
</section>
|
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
|
<h4>Der Boot-Ablauf mit systemd</h4>
|
||||||
|
<img style="max-height: 50vh" src="img/startup-systemd.png">
|
||||||
|
<p><small> Das initramfs ist ein komprimiertes Archiv, das für den Systemstart benötigte Dateien enthält.</small>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="lib/js/head.min.js"></script>
|
<script src="lib/js/head.min.js"></script>
|
||||||
|
9
beispiele/8/hello-web.service
Normal file
9
beispiele/8/hello-web.service
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Simple WSGI Server
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
ExecStart=/home/USERNAME-HIER-EINSETZEN/hello-web.sh
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
2
beispiele/8/hello-web.sh
Normal file
2
beispiele/8/hello-web.sh
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
cd /home/; python3 -m http.server 8082
|
BIN
img/startup-systemd.png
Normal file
BIN
img/startup-systemd.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 49 KiB |
@ -23,6 +23,7 @@
|
|||||||
<li><a href="5.html">5. Abend - Bash Scripting Fortsetzung</a></li>
|
<li><a href="5.html">5. Abend - Bash Scripting Fortsetzung</a></li>
|
||||||
<li><a href="6.html">6. Abend - vim / emacs</a></li>
|
<li><a href="6.html">6. Abend - vim / emacs</a></li>
|
||||||
<li><a href="7.html">7. Abend - Systemverwaltung</a></li>
|
<li><a href="7.html">7. Abend - Systemverwaltung</a></li>
|
||||||
|
<li><a href="8.html">8. Abend - Systemd</a></li>
|
||||||
</ol>
|
</ol>
|
||||||
|
|
||||||
<div class="ui left aligned padded grid">
|
<div class="ui left aligned padded grid">
|
||||||
@ -78,6 +79,9 @@
|
|||||||
<li><a href="https://www.gnu.org/software/emacs/">Offizielle emacs Seite</a></li>
|
<li><a href="https://www.gnu.org/software/emacs/">Offizielle emacs Seite</a></li>
|
||||||
<li><a href="http://ergoemacs.org/emacs/emacs_basics.html" target="_blank">Emacs Basics</a></li>
|
<li><a href="http://ergoemacs.org/emacs/emacs_basics.html" target="_blank">Emacs Basics</a></li>
|
||||||
<li><a href="https://www.gnu.org/software/emacs/refcards/pdf/de-refcard.pdf" target="_blank">GNU Emacs Referenzkarte</a>
|
<li><a href="https://www.gnu.org/software/emacs/refcards/pdf/de-refcard.pdf" target="_blank">GNU Emacs Referenzkarte</a>
|
||||||
|
<h3>systemd</h3>
|
||||||
|
<li><a href="https://wiki.archlinux.org/index.php/Systemd" target="_blank">Arch Wiki - Systemd</a></li>
|
||||||
|
<li><a href="https://wiki.debian.org/systemd" >Debian.org - Systemd</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user