Difference between revisions of "User:Grandchild/systemd"

From ArchWiki
Jump to navigation Jump to search
m (Grandchild moved page User:Grandchild/test to User:Grandchild/systemd: actual reason)
(draft1)
Line 1: Line 1:
hallo
+
== Installation ==
 +
{{Pkg|systemd}} is installed by default on any new Arch installation since [https://www.archlinux.org/news/systemd-is-now-the-default-on-new-installations/ late 2012].
 +
 
 +
== Getting started ==
 +
To list a state of all the currently enabled units on the system simply run
 +
$ systemctl
 +
 +
  UNIT                            LOAD  ACTIVE SUB      DESCRIPTION
 +
  dhcpcd.service                  loaded active running  dhcpcd on all interfaces
 +
  systemd-modules-load.service    loaded active exited    Load Kernel Modules
 +
● shadow.service                  loaded failed failed    Verify integrity of password and group files
 +
  ...
 +
 
 +
To start a service, for example [[mpd]], run
 +
# systemctl start mpd
 +
 
 +
To have a service always start on system boot run
 +
# systemctl enable mpd
 +
On success this command will output information on linking the unit file to the wanted units. No output indicates something went wrong (or often that the unit was already enabled).
 +
 
 +
To investigate a unit's status, like ''shadow.service'' which is marked as failed above, run
 +
$ systemctl status shadow.service
 +
This will print out some general information about the unit and the last few journal/log messages - if there are any - which might enable you to track down why a unit might have failed to start.
 +
 
 +
== Terminology ==
 +
The basic component of systemd is a '''Unit'''. There are several types of units. Mostly you will interact with the ''.service'' type of units. See the [[#Units|Units]] section for a detailed description of the various types and tasks.
 +
 
 +
The logs of systemd are '''Journals'''. The basic command to interact with this functionality is {{ic|1=journalctl}}
 +
 
 +
== Units ==
 +
=== Types ===
 +
=== Unit Files ===
 +
 
 +
 
 +
== Reference ==
 +
=== Common ''systemctl'' commands ===
 +
 
 +
{| class="wikitable"
 +
! Command !! Argument !! Task
 +
|-
 +
| start || ''unit name'' || Start a unit
 +
|-
 +
| 1, s, single || runlevel1.target, rescue.target || Single user mode.
 +
|-
 +
| 2, 4 || runlevel2.target, runlevel4.target, multi-user.target || User-defined/Site-specific runlevels. By default, identical to 3.
 +
|-
 +
| 3 || runlevel3.target, multi-user.target || Multi-user, non-graphical. Users can usually login via multiple consoles or via the network.
 +
|-
 +
| 5 || runlevel5.target, graphical.target || Multi-user, graphical. Usually has all the services of runlevel 3 plus a graphical login.
 +
|-
 +
| 6 || runlevel6.target, reboot.target || Reboot
 +
|-
 +
| emergency || emergency.target || Emergency shell
 +
|-
 +
|}

Revision as of 21:37, 4 September 2014

Installation

systemd is installed by default on any new Arch installation since late 2012.

Getting started

To list a state of all the currently enabled units on the system simply run

$ systemctl

  UNIT                            LOAD   ACTIVE SUB       DESCRIPTION
  dhcpcd.service                  loaded active running   dhcpcd on all interfaces
  systemd-modules-load.service    loaded active exited    Load Kernel Modules
● shadow.service                  loaded failed failed    Verify integrity of password and group files
  ...

To start a service, for example mpd, run

# systemctl start mpd

To have a service always start on system boot run

# systemctl enable mpd

On success this command will output information on linking the unit file to the wanted units. No output indicates something went wrong (or often that the unit was already enabled).

To investigate a unit's status, like shadow.service which is marked as failed above, run

$ systemctl status shadow.service

This will print out some general information about the unit and the last few journal/log messages - if there are any - which might enable you to track down why a unit might have failed to start.

Terminology

The basic component of systemd is a Unit. There are several types of units. Mostly you will interact with the .service type of units. See the Units section for a detailed description of the various types and tasks.

The logs of systemd are Journals. The basic command to interact with this functionality is journalctl

Units

Types

Unit Files

Reference

Common systemctl commands

Command Argument Task
start unit name Start a unit
1, s, single runlevel1.target, rescue.target Single user mode.
2, 4 runlevel2.target, runlevel4.target, multi-user.target User-defined/Site-specific runlevels. By default, identical to 3.
3 runlevel3.target, multi-user.target Multi-user, non-graphical. Users can usually login via multiple consoles or via the network.
5 runlevel5.target, graphical.target Multi-user, graphical. Usually has all the services of runlevel 3 plus a graphical login.
6 runlevel6.target, reboot.target Reboot
emergency emergency.target Emergency shell