{"id":17723,"date":"2025-01-06T14:05:29","date_gmt":"2025-01-06T13:05:29","guid":{"rendered":"https:\/\/linux-bibel.at\/?p=17723"},"modified":"2025-01-06T14:06:29","modified_gmt":"2025-01-06T13:06:29","slug":"noch-mehr-systemd-die-steuerzentrale-unter-linux","status":"publish","type":"post","link":"https:\/\/linux-bibel.at\/index.php\/2025\/01\/06\/noch-mehr-systemd-die-steuerzentrale-unter-linux\/","title":{"rendered":"Noch mehr Systemd &#8211; die Steuerzentrale unter Linux"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Unter <a href=\"https:\/\/linux-bibel.at\/index.php\/2023\/09\/03\/systemd-die-steuerzentrale-von-linux\/\" data-type=\"post\" data-id=\"783\">Systemd<\/a> haben wir bereits einen kleinen Einstieg in die Steuerzentrale f\u00fcr Linux bekommen &#8211; hier gehen wir jetzt etwas weiter.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Die meisten Befehle, solange sie das System betreffen, werden nat\u00fcrlich als root abgegeben &#8211; also los, ran ans Terminal:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Services:<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Services, also Dienste, sind wohl die wichtigsten Komponenten unter Systemd. Services sind Software oder Prozesse. Beispielsweise eine Datenbank, wie etwa MariaDB. Lassen wir uns diese Services einmal auflisten:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl --type=service<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd.jpeg\" rel=\"lightbox-0\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-1024x576.jpeg\" alt=\"\" class=\"wp-image-17724\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-1024x576.jpeg 1024w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-1536x864.jpeg 1536w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-150x84.jpeg 150w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-300x169.jpeg 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-768x432.jpeg 768w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd.jpeg 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Die Spalte &#8222;<strong>UNIT<\/strong>&#8220; zeigt uns den Service-Namen, meist ist dieser mit der zugeh\u00f6rigen Software recht passend. Die Spalte &#8222;<strong>LOAD<\/strong>&#8220; zeigt uns den Status beim Start des Systems &#8211; &#8222;<strong>loaded<\/strong>&#8220; zeigt uns &#8211; das Service wird beim Systemstart gestartet. &#8222;<strong>ACTIVE<\/strong>&#8220; zeigt uns wiederum, der Service soll auch beim Start des Systems starten &#8211; Sie k\u00f6nnen einen Service ja auch manuell starten. &#8222;<strong>SUB<\/strong>&#8220; bietet uns die Information, ob der Service aktuell l\u00e4uft oder auch nicht &#8211; &#8222;<strong>running<\/strong>&#8220; l\u00e4uft, &#8222;<strong>exited<\/strong>&#8220; &#8211; l\u00e4uft nat\u00fcrlich nicht &#8211; ein Service muss ja nicht dauerhaft laufen. &#8222;<strong>DESCRIPTION<\/strong>&#8220; zeigt uns wiederum eine kurze Beschreibung.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Wir k\u00f6nnen einen Service starten:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl start mariadb.service<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Einen solchen nat\u00fcrlich auch stoppen:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl stop mariadb.service<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Diesen neu starten:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl restart mariadb.service<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Bei manchen Services ist es auch m\u00f6glich, dessen Konfiguration neu zu laden, ohne diesen neu zu starten (<em>ein Neustart dauert meist l\u00e4nger<\/em>), dies ist nicht bei allen Services m\u00f6glich &#8211; es wird einfach ein Fehler gemeldet:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl reload mariadb.service<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Wir k\u00f6nnen den automatischen Start mit dem System aktivieren (<em>diese Einstellung wird beim n\u00e4chsten Start \/ Neustart aktiv<\/em>):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl enable mariadb.service<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Oder auch deaktivieren:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl disable mariadb.service<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Die funktioniert nat\u00fcrlich auch sofort ohne Neustart:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl enable --now mariadb.service\nsystemctl disable --now mariadb.service<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Wir k\u00f6nnen uns auch den Status des Service anzeigen lassen:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl status mariadb.service<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-1.jpeg\" rel=\"lightbox-1\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"293\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-1-1024x293.jpeg\" alt=\"\" class=\"wp-image-17725\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-1-1024x293.jpeg 1024w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-1-1536x440.jpeg 1536w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-1-150x43.jpeg 150w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-1-300x86.jpeg 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-1-768x220.jpeg 768w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-1.jpeg 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Standardm\u00e4\u00dfig werden uns mit <code>systemctl --type=service<\/code> nur die geladenen Services angezeigt, nutzen Sie zus\u00e4tzlich die Option <code>--all<\/code>, sehen Sie wirklich alle:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl --type=service --all<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-2.jpeg\" rel=\"lightbox-2\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-2-1024x576.jpeg\" alt=\"\" class=\"wp-image-17726\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-2-1024x576.jpeg 1024w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-2-1536x864.jpeg 1536w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-2-150x84.jpeg 150w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-2-300x169.jpeg 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-2-768x432.jpeg 768w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-2.jpeg 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Sockets<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Neben den Services existieren auch sogenannte Sockets &#8211; Sockets dienen so mancher Software zur Kommunikation innerhalb des Systems. So gesehen, das Betriebssystem interne Netzwerk. Lassen wir uns diese anzeigen:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl --type=socket<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-3.jpeg\" rel=\"lightbox-3\"><img loading=\"lazy\" decoding=\"async\" width=\"958\" height=\"660\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-3.jpeg\" alt=\"\" class=\"wp-image-17727\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-3.jpeg 958w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-3-150x103.jpeg 150w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-3-300x207.jpeg 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-3-768x529.jpeg 768w\" sizes=\"auto, (max-width: 958px) 100vw, 958px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Und jetzt alle:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl --type=socket --all<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-4.jpeg\" rel=\"lightbox-4\"><img loading=\"lazy\" decoding=\"async\" width=\"958\" height=\"811\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-4.jpeg\" alt=\"\" class=\"wp-image-17728\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-4.jpeg 958w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-4-150x127.jpeg 150w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-4-300x254.jpeg 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-4-768x650.jpeg 768w\" sizes=\"auto, (max-width: 958px) 100vw, 958px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Gesteuert werden die Sockets, wie die Services.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Targets:<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Targets sind so gesehen die aktuellen Zust\u00e4nde des Betriebssystems, solche Zust\u00e4nde w\u00e4re etwa der Multi-User-Target &#8211; der Standard, mit Netzwerk und grafischer Oberfl\u00e4che, der Reboot-Target &#8211; startet das System neu, der Shutdown-Target &#8211; f\u00e4hrt das Betriebssystem herunter und viele mehr &#8211; lassen wir uns diese anzeigen:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl --type=target<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-5.jpeg\" rel=\"lightbox-5\"><img loading=\"lazy\" decoding=\"async\" width=\"958\" height=\"697\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-5.jpeg\" alt=\"\" class=\"wp-image-17729\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-5.jpeg 958w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-5-150x109.jpeg 150w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-5-300x218.jpeg 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-5-768x559.jpeg 768w\" sizes=\"auto, (max-width: 958px) 100vw, 958px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Auch hier &#8211; es werden uns nur die aktiven Targets angezeigt &#8211; mit der Option <code>--all<\/code> sehen wir alle:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-6.jpeg\" rel=\"lightbox-6\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-6-1024x576.jpeg\" alt=\"\" class=\"wp-image-17730\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-6-1024x576.jpeg 1024w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-6-1536x864.jpeg 1536w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-6-150x84.jpeg 150w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-6-300x169.jpeg 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-6-768x432.jpeg 768w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-6.jpeg 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">In meinem Beispiel ist etwa der <strong>hibernate.target<\/strong>, <strong>suspend.target<\/strong> und weitere nicht aktiv &#8211; ich brauche diese einfach nicht. Will ich diese aktivieren &#8211; dieselbe Geschichte, wie bei den Services:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl enable hibernate.target\nsystemctl enable --now hibernate.target\n...<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Wollen wir uns einmal ansehen, welcher Target standardm\u00e4\u00dfig startet:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl get-default<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"588\" height=\"137\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-7.jpeg\" alt=\"\" class=\"wp-image-17731\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-7.jpeg 588w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-7-150x35.jpeg 150w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-7-300x70.jpeg 300w\" sizes=\"auto, (max-width: 588px) 100vw, 588px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Das System startet also standardm\u00e4\u00dfig in den <strong>graphical Target<\/strong>. Ist das System etwa gerade im <strong>suspend-then-hibernate.target<\/strong> &#8211; also im Schlafmodus und die GUI will aus welchem Grund auch immer nicht wieder aufstehen:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl graphical.target<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Mit der Option <code>set-default<\/code> k\u00f6nnen Sie wiederum das Standard-Target \u00e4ndern &#8211; in diesem Beispiel soll das System nur in das Terminal starten &#8211; also ohne GUI:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl set-default multi-user.target<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Weiteres:<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Wir k\u00f6nnen uns ansehen, welche Prozesse zum einem Service geh\u00f6ren:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemd-cgls -u mariadb.service<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-8.jpeg\" rel=\"lightbox-7\"><img loading=\"lazy\" decoding=\"async\" width=\"630\" height=\"167\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-8.jpeg\" alt=\"\" class=\"wp-image-17732\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-8.jpeg 630w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-8-150x40.jpeg 150w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-8-300x80.jpeg 300w\" sizes=\"auto, (max-width: 630px) 100vw, 630px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Wir k\u00f6nnen uns auch die Log-Meldungen nur f\u00fcr einen Service anzeigen lassen:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>journalctl -u mariadb.service<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-9.jpeg\" rel=\"lightbox-8\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-9-1024x576.jpeg\" alt=\"\" class=\"wp-image-17733\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-9-1024x576.jpeg 1024w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-9-1536x864.jpeg 1536w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-9-150x84.jpeg 150w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-9-300x169.jpeg 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-9-768x432.jpeg 768w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-9.jpeg 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Wir k\u00f6nnen uns auch die Konfigurationsdatei eines Services, eines Sockets oder eines Targets anzeigen lassen, ohne den Pfad zur Datei anzugeben:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl cat mariadb.service<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-10.jpeg\" rel=\"lightbox-9\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-10-1024x576.jpeg\" alt=\"\" class=\"wp-image-17734\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-10-1024x576.jpeg 1024w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-10-1536x864.jpeg 1536w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-10-150x84.jpeg 150w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-10-300x169.jpeg 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-10-768x432.jpeg 768w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-10.jpeg 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Auch k\u00f6nnen wir uns ansehen, welche Abh\u00e4ngigkeiten ein Service hat:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl list-dependencies mariadb.service<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-11.jpeg\" rel=\"lightbox-10\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-11-1024x576.jpeg\" alt=\"\" class=\"wp-image-17735\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-11-1024x576.jpeg 1024w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-11-1536x864.jpeg 1536w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-11-150x84.jpeg 150w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-11-300x169.jpeg 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-11-768x432.jpeg 768w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-11.jpeg 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Oder auch alles, was einen Service betrifft:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl show mariadb.service<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-12.jpeg\" rel=\"lightbox-11\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-12-1024x576.jpeg\" alt=\"\" class=\"wp-image-17736\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-12-1024x576.jpeg 1024w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-12-1536x864.jpeg 1536w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-12-150x84.jpeg 150w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-12-300x169.jpeg 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-12-768x432.jpeg 768w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-12.jpeg 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Mit folgendem Befehl lassen wir uns alle Service-, Socket- und Target-Dateien anzeigen:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl list-unit-files<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-13.jpeg\" rel=\"lightbox-12\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-13-1024x576.jpeg\" alt=\"\" class=\"wp-image-17737\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-13-1024x576.jpeg 1024w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-13-1536x864.jpeg 1536w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-13-150x84.jpeg 150w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-13-300x169.jpeg 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-13-768x432.jpeg 768w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2025\/01\/systemd-13.jpeg 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Sie k\u00f6nnen auch ein Service, Socket oder Target dazu bringen, \u00fcberhaupt nicht zu starten &#8211; auch wenn es etwa jemand anderes starten will:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl mask mariadb.service<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Jetzt l\u00e4sst sich das Service auch mit:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl start mariadb.service<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">nicht starten, auch nicht automatisch, &#8230; In der Ausgabe des Befehls <code>systemctl list-unit-files<\/code>, sind solche dann mit <strong>masked<\/strong> markiert. Diese Beschr\u00e4nkung k\u00f6nnen Sie mit folgendem Befehl wieder aufheben:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl unmask mariadb.service<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Die meisten Benutzer editieren die Dateien der Units (<em>Services, Sockets und Targets<\/em>) mit einem Editor &#8211; hierzu muss man nat\u00fcrlich auch den Pfad zur Datei angeben &#8211; umst\u00e4ndlich. Will ich zu einer solchen Datei etwas hinzuf\u00fcgen:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl edit mariadb.service<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Die passende Datei wird ge\u00f6ffnet &#8211; aber nicht direkt bearbeitet. Es wird ein Verzeichnis im Verzeichnis mit der Datei erstellt &#8211; im Beispiel also &#8222;<em>mariadb.service.d<\/em>&#8220; und die hinzugef\u00fcgten \u00c4nderungen darin abgelegt. M\u00f6chten Sie die Datei direkt bearbeiten &#8211; also bestehenden Einstellungen \u00e4ndern, nutzen Sie die Option <code>--full<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl edit --full mariadb.service<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Nach dem \u00c4ndern an Dateien und Verzeichnissen sollte immer folgender Befehl erfolgen:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl daemon-reload<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Anschlie\u00dfend wird das Service selbst neu geladen oder gestartet &#8211; also etwa:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl reload mariadb.service\nsystemctl restart mariadb.service<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n<div class=\"pld-like-dislike-wrap pld-custom\">\r\n    <div class=\"pld-like-wrap  pld-common-wrap\">\r\n    <a href=\"javascript:void(0)\" class=\"pld-like-trigger pld-like-dislike-trigger  \" title=\"Gef\u00e4llt mir\" data-post-id=\"17723\" data-trigger-type=\"like\" data-restriction=\"cookie\" data-already-liked=\"0\">\r\n                            <img src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/12\/Daumen-Hoch.png\" alt=\"Gef\u00e4llt mir\" \/>\r\n            <\/a>\r\n    <span class=\"pld-like-count-wrap pld-count-wrap\">10    <\/span>\r\n<\/div><div class=\"pld-dislike-wrap  pld-common-wrap\">\r\n    <a href=\"javascript:void(0)\" class=\"pld-dislike-trigger pld-like-dislike-trigger  \" title=\"Gef\u00e4llt mir nicht\" data-post-id=\"17723\" data-trigger-type=\"dislike\" data-restriction=\"cookie\" data-already-liked=\"0\">\r\n                            <img src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/12\/Daumen-Runter.png\" alt=\"Gef\u00e4llt mir nicht\" \/>\r\n            <\/a>\r\n    <span class=\"pld-dislike-count-wrap pld-count-wrap\"><\/span>\r\n<\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>Unter Systemd haben wir bereits einen kleinen Einstieg in die Steuerzentrale f\u00fcr Linux bekommen &#8211; hier gehen wir jetzt etwas weiter. Die meisten Befehle, solange sie das System betreffen, werden nat\u00fcrlich als root abgegeben &#8211; also los, ran ans Terminal: Services: Services, also Dienste, sind wohl die wichtigsten Komponenten unter Systemd. Services sind Software oder [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":763,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[15],"class_list":["post-17723","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-system","tag-system"],"_links":{"self":[{"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/posts\/17723","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/comments?post=17723"}],"version-history":[{"count":3,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/posts\/17723\/revisions"}],"predecessor-version":[{"id":17740,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/posts\/17723\/revisions\/17740"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/media\/763"}],"wp:attachment":[{"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/media?parent=17723"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/categories?post=17723"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/tags?post=17723"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}