Systemd: Unterschied zwischen den Versionen

Aus Doku-Wiki
Zur Navigation springenZur Suche springen
Zeile 2: Zeile 2:
 
* [https://wiki.ubuntuusers.de/systemd/Units/ Ubuntu Users - Systemd Units]
 
* [https://wiki.ubuntuusers.de/systemd/Units/ Ubuntu Users - Systemd Units]
  
=systemd Startscript=
+
=Systemd=
 +
==systemd Startscript==
 
Minimale angaben für ein Systemd-Startscript sind:
 
Minimale angaben für ein Systemd-Startscript sind:
 
  '''vi  /etc/systemd/system/test.service'''
 
  '''vi  /etc/systemd/system/test.service'''
Zeile 22: Zeile 23:
 
  [Service]
 
  [Service]
 
  ExecStart=/usr/local/sbin/test.script
 
  ExecStart=/usr/local/sbin/test.script
 +
 +
==systemctl Befehle==
 +
Eine neue Unit aktivieren / deaktivieren / status
 +
sudo systemctl enable NAME_DER_UNIT_DATEI
 +
sudo systemctl disable NAME_DER_UNIT_DATEI
 +
sudo systemctl is-enabled NAME_DER_UNIT_DATEI
 +
 +
==Systemd Unit bearbeiten==
 +
sudo systemctl edit --full NAME_DER_UNIT_DATE
 
   
 
   
 
  [Install]
 
  [Install]
 
  WantedBy=multi-user.target
 
  WantedBy=multi-user.target
 +
 +
=Systemd analyze=
 +
* [https://wiki.ubuntuusers.de/systemd/systemd-analyze/ Ubuntu Usere systemd-analyze Doku]
 +
Mit systemd-analyze lässt sich das System (Bootvorgang) analysieren
 +
systemd-analyze time
  
  
 
[[Kategorie:Linux]]
 
[[Kategorie:Linux]]
 
[[Kategorie:Ubuntu]]
 
[[Kategorie:Ubuntu]]

Version vom 28. August 2018, 09:14 Uhr

Links zu Dokumentationen

Systemd

systemd Startscript

Minimale angaben für ein Systemd-Startscript sind:

vi  /etc/systemd/system/test.service
  • Service Name
[Unit]
Description=test service
  • Start Daemon/Script
[Service]
ExecStart=/usr/local/sbin/test.script
  • Wann wird der Service gestartet

multi-user.target ist der Standard, auch bei Server ohne grafische Oberfläche

[Install]
WantedBy=multi-user.target
  • Ein minimales Startscript sieht also so aus:
[Unit]
Description=test service

[Service]
ExecStart=/usr/local/sbin/test.script

systemctl Befehle

Eine neue Unit aktivieren / deaktivieren / status

sudo systemctl enable NAME_DER_UNIT_DATEI 
sudo systemctl disable NAME_DER_UNIT_DATEI
sudo systemctl is-enabled NAME_DER_UNIT_DATEI

Systemd Unit bearbeiten

sudo systemctl edit --full NAME_DER_UNIT_DATE

[Install]
WantedBy=multi-user.target

Systemd analyze

Mit systemd-analyze lässt sich das System (Bootvorgang) analysieren

systemd-analyze time