Zum Inhalt springen

Runlevel/Default: Unterschied zwischen den Versionen

Aus Foxwiki
Die 5 zuletzt angesehenen Seiten:  Spezial:API-Hilfe » Linux/Dateisystem/Hierarchie » SSH/Server » STARTTLS » Runlevel/Default
Die Seite wurde neu angelegt: „Default runlevel in Debian 10 / Debian 9 201-10-09 In Debian 10 / Debian 9, systemd uses targets instead of run-levels. The /etc/inittab file is no longer use…“
 
K Textersetzung - „line>“ durch „line copy>“
 
(51 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 1: Zeile 1:
Default runlevel in Debian 10 / Debian 9
'''Runlevel/Default''' - Beschreibung
201-10-09


In Debian 10 / Debian 9, systemd uses targets instead of run-levels. The /etc/inittab file is no longer used by systemd to change run levels.
== Beschreibung ==
; [[systemd/target]]s und [[runlevel]]


Change Default runlevel
; Seit Debian 9
[[/etc/inittab]]
* wird von systemd nicht mehr verwendet
* um [[Ausführungsebenen]] zu ändern


The Default runlevel can be set either by using the systemctl command or making a symbolic link of runlevel targets file to the default target file.
== Anwendung ==
<syntaxhighlight lang="bash" highlight="1" line copy>
</syntaxhighlight>
== Ändere Standard-Runlevel ==
Der Standard-Runlevel kann entweder mit dem Befehl systemctl oder durch Erstellen eines symbolischen Links der Runlevel-Zieldatei zur Standard-Zieldatei festgelegt werden


Method 1
=== Methode 1 ===
Let’s check the current run level by using the following command.
Lassen Sie uns den aktuellen Runlevel mit dem folgenden Befehl überprüfen
# systemctl get-default
<syntaxhighlight lang="bash" highlight="1" line copy>
graphical.target
sudo systemctl get-default
graphical.target
</syntaxhighlight>


Before changing the default runlevel, check out the available targets.
Bevor Sie den Standard-Runlevel ändern, überprüfen Sie die verfügbaren Ziele
# systemctl list-units --type=target
<syntaxhighlight lang="bash" highlight="1" line copy>
  UNIT                   LOAD   ACTIVE SUB   DESCRIPTION
sudo systemctl list-units --type=target
  basic.target           loaded active active Basic System
  UNIT LOAD ACTIVE SUB DESCRIPTION
  cryptsetup.target     loaded active active Encrypted Volumes
  basic.target loaded active active Basic System
  getty.target           loaded active active Login Prompts
  cryptsetup.target loaded active active Encrypted Volumes
  graphical.target       loaded active active Graphical Interface
  getty.target loaded active active Login Prompts
  local-fs-pre.target   loaded active active Local File Systems (Pre)
  graphical.target loaded active active Graphical Interface
  local-fs.target       loaded active active Local File Systems
  local-fs-pre.target loaded active active Local File Systems (Pre)
  multi-user.target     loaded active active Multi-User System
  local-fs.target loaded active active Local File Systems
  network-online.target loaded active active Network is Online
  multi-user.target loaded active active Multi-User System
  network.target         loaded active active Network
  network-online.target loaded active active Network is Online
  network.target loaded active active Network
  nss-user-lookup.target loaded active active User and Group Name Lookups
  nss-user-lookup.target loaded active active User and Group Name Lookups
  paths.target           loaded active active Paths
  paths.target loaded active active Paths
  remote-fs.target       loaded active active Remote File Systems
  remote-fs.target loaded active active Remote File Systems
  slices.target         loaded active active Slices
  slices.target loaded active active Slices
  sockets.target         loaded active active Sockets
  sockets.target loaded active active Sockets
  sound.target           loaded active active Sound Card
  sound.target loaded active active Sound Card
  swap.target           loaded active active Swap
  swap.target loaded active active Swap
  sysinit.target         loaded active active System Initialization
  sysinit.target loaded active active System Initialization
  time-sync.target       loaded active active System Time Synchronized
  time-sync.target loaded active active System Time Synchronized
  timers.target         loaded active active Timers
  timers.target loaded active active Timers
   
   
  LOAD   = Reflects whether the unit definition was properly loaded.
  LOAD = Reflects whether the unit definition was properly loaded
  ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
  ACTIVE = The high-level unit activation state, i.e. generalization of SUB
  SUB   = The low-level unit activation state, values depend on unit type.
  SUB = The low-level unit activation state, values depend on unit type
</syntaxhighlight>
Geben Sie den folgenden Befehl ein, um den Standard-Runlevel in Runlevel 3 (nichts anderes als ein multi-user.target) zu ändern.
<syntaxhighlight lang="bash" highlight="1" line copy>
sudo systemctl set-default multi-user.target
</syntaxhighlight>
 
Bestätigen des Standard-Runlevel
<syntaxhighlight lang="bash" highlight="1" line copy>
sudo systemctl get-default
multi-user.target
</syntaxhighlight>


Issue the following command to change the default runlevel to runlevel 3 (nothing but a multi-user.target).
Neustart und ausprobieren
# systemctl set-default multi-user.target
<syntaxhighlight lang="bash" highlight="1" line copy>
sudo reboot
</syntaxhighlight>


Confirm the default runlevel.
=== Methode 2 ===
# systemctl get-default
Bei der vorherigen Methode haben wir den Runlevel 3 als Standard-Runlevel festgelegt
* Sie können dies auch mit dem folgenden Befehl bestätigen
<syntaxhighlight lang="bash" highlight="1" line copy>
sudo systemctl get-default
  multi-user.target
  multi-user.target
</syntaxhighlight>


Reboot and check it out.
Für eine Demo geben Sie den folgenden Befehl ein, um Runlevel 5 als Standard-Runlevel festzulegen
# reboot
<syntaxhighlight lang="bash" highlight="1" line copy>
sudo ln -sf /lib/systemd/system/runlevel5.target /etc/systemd/system/default.target
</syntaxhighlight>
OR
<syntaxhighlight lang="bash" highlight="1" line copy>
sudo ln -sf /lib/systemd/system/graphical.target /etc/systemd/system/default.target
</syntaxhighlight>


Method 2
Überprüfen Sie erneut den aktuellen Level
In the previous method, we made the runlevel 3 as the default runlevel. You can also confirm that using the following command.
#systemctl get-default
multi-user.target
For a demo, issue the following command to make runlevel 5 as the default runlevel.
# ln -sf /lib/systemd/system/runlevel5.target /etc/systemd/system/default.target
OR
# ln -sf /lib/systemd/system/graphical.target /etc/systemd/system/default.target


Again check the current level. Now the default runlevel is the graphical mode(runlevel 5).
* Jetzt ist der Standard-Runlevel der grafische Modus (Runlevel 5)
# systemctl get-default
<syntaxhighlight lang="bash" highlight="1" line="">
sudo systemctl get-default
  graphical.target
  graphical.target
</syntaxhighlight>
Starten Sie den Computer neu und überprüfen Sie ihn.
<syntaxhighlight lang="bash" highlight="1" line="">
sudo reboot
</syntaxhighlight>
=== Problembehebung ===
== Konfiguration ==
=== Dateien ===
{| class="wikitable options"
|-
! Datei !! Beschreibung
|-
| [[/proc/sys]] ||
|-
| [[/etc/sysctl.conf]] ||
|}
<noinclude>
== Anhang ==
=== Siehe auch ===
{{Special:PrefixIndex/Runlevel}}
=== Dokumentation ===
; Man-Page
;Info-Page
=== Links ===
==== Projekt ====
==== Weblinks ====
# https://www.itzgeek.com/how-tos/linux/debian/change-default-runlevel-debian-9.html
# https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/system_administrators_guide/sect-managing_services_with_systemd-targets
# https://www.admin-magazin.de/Das-Heft/2014/10/Systemstart-mit-Systemd-unter-Linux
# https://www.systutorials.com/239880/change-systemd-boot-target-linux/
# https://wiki.debian.org/systemd
{{DEFAULTSORT:Runlevel/Default}}
{{DISPLAYTITLE:Runlevel/Default}}


Reboot the machine and check it out.
[[Kategorie:Systemd]]
# reboot
[[Kategorie:Init]]


[[Benutzer:Dirkwagner|Dirkwagner]] ([[Benutzer Diskussion:Dirkwagner|Diskussion]])
</noinclude>

Aktuelle Version vom 11. Mai 2025, 13:41 Uhr

Runlevel/Default - Beschreibung

Beschreibung

systemd/targets und runlevel
Seit Debian 9

/etc/inittab

Anwendung

Ändere Standard-Runlevel

Der Standard-Runlevel kann entweder mit dem Befehl systemctl oder durch Erstellen eines symbolischen Links der Runlevel-Zieldatei zur Standard-Zieldatei festgelegt werden

Methode 1

Lassen Sie uns den aktuellen Runlevel mit dem folgenden Befehl überprüfen

sudo systemctl get-default
graphical.target

Bevor Sie den Standard-Runlevel ändern, überprüfen Sie die verfügbaren Ziele

sudo systemctl list-units --type=target
 UNIT LOAD ACTIVE SUB DESCRIPTION
 basic.target loaded active active Basic System
 cryptsetup.target loaded active active Encrypted Volumes
 getty.target loaded active active Login Prompts
 graphical.target loaded active active Graphical Interface
 local-fs-pre.target loaded active active Local File Systems (Pre)
 local-fs.target loaded active active Local File Systems
 multi-user.target loaded active active Multi-User System
 network-online.target loaded active active Network is Online
 network.target loaded active active Network
 nss-user-lookup.target loaded active active User and Group Name Lookups
 paths.target loaded active active Paths
 remote-fs.target loaded active active Remote File Systems
 slices.target loaded active active Slices
 sockets.target loaded active active Sockets
 sound.target loaded active active Sound Card
 swap.target loaded active active Swap
 sysinit.target loaded active active System Initialization
 time-sync.target loaded active active System Time Synchronized
 timers.target loaded active active Timers
 
 LOAD = Reflects whether the unit definition was properly loaded
 ACTIVE = The high-level unit activation state, i.e. generalization of SUB
 SUB = The low-level unit activation state, values depend on unit type

Geben Sie den folgenden Befehl ein, um den Standard-Runlevel in Runlevel 3 (nichts anderes als ein multi-user.target) zu ändern.

sudo systemctl set-default multi-user.target

Bestätigen des Standard-Runlevel

sudo systemctl get-default
 multi-user.target

Neustart und ausprobieren

sudo reboot

Methode 2

Bei der vorherigen Methode haben wir den Runlevel 3 als Standard-Runlevel festgelegt

  • Sie können dies auch mit dem folgenden Befehl bestätigen
sudo systemctl get-default
 multi-user.target

Für eine Demo geben Sie den folgenden Befehl ein, um Runlevel 5 als Standard-Runlevel festzulegen

sudo ln -sf /lib/systemd/system/runlevel5.target /etc/systemd/system/default.target

OR

sudo ln -sf /lib/systemd/system/graphical.target /etc/systemd/system/default.target

Überprüfen Sie erneut den aktuellen Level

  • Jetzt ist der Standard-Runlevel der grafische Modus (Runlevel 5)
sudo systemctl get-default
 graphical.target

Starten Sie den Computer neu und überprüfen Sie ihn.

sudo reboot

Problembehebung

Konfiguration

Dateien

Datei Beschreibung
/proc/sys
/etc/sysctl.conf


Anhang

Siehe auch

Dokumentation

Man-Page
Info-Page

Links

Projekt

Weblinks

  1. https://www.itzgeek.com/how-tos/linux/debian/change-default-runlevel-debian-9.html
  2. https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/system_administrators_guide/sect-managing_services_with_systemd-targets
  3. https://www.admin-magazin.de/Das-Heft/2014/10/Systemstart-mit-Systemd-unter-Linux
  4. https://www.systutorials.com/239880/change-systemd-boot-target-linux/
  5. https://wiki.debian.org/systemd