0% found this document useful (0 votes)
7 views38 pages

Redhat Systemd

The document provides an overview of systemd, a system and service manager for Linux, highlighting its objectives, unit types, and basic operations for managing units. It contrasts the legacy boot sequences of RHEL5 and RHEL6 with systemd's approach, emphasizing improved startup times and dynamic configuration. Additionally, it covers journald, the logging mechanism of systemd, detailing how to search logs and manage log entries.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views38 pages

Redhat Systemd

The document provides an overview of systemd, a system and service manager for Linux, highlighting its objectives, unit types, and basic operations for managing units. It contrasts the legacy boot sequences of RHEL5 and RHEL6 with systemd's approach, emphasizing improved startup times and dynamic configuration. Additionally, it covers journald, the logging mechanism of systemd, detailing how to search logs and manage log entries.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Red Hat Customer Convergence

#rhconvergence

1 RED HAT CONFIDENTIAL | BRYAN TOTTY, JUSTIN STEPHENSON


#rhconvergence
RHEL7 SYSTEMD BASICS
Justin Stephenson, Bryan Totty
Technical Support Engineers
February 6, 2014

2 RED HAT CONFIDENTIAL | BRYAN TOTTY, JUSTIN STEPHENSON


#rhconvergence
Presentation Outline

● Review Legacy Boot Sequence


● systemd Overview
● Managing Units - Basic Operations
● journald
● Unit Configuration Files
● cgroups and Resource Management
● Convert Legacy Unit/Upstart file

3 RED HAT CONFIDENTIAL | BRYAN TOTTY, JUSTIN STEPHENSON


#rhconvergence
Review Legacy Boot Sequence
SysVinit Scripts in RHEL5 and RHEL6

An “init script” loads appropriate device drivers and mounts the root filesystem. It then
executes the initial process /sbin/init.
NOTE: Strictly speaking, “init script” is replaced by /sbin/init with “exec” command.

This /sbin/init binary is the main body of the traditional SysVinit or Upstart. Under the
systemd environment, this will be /usr/bin/systemd instead.

4 RED HAT CONFIDENTIAL | BRYAN TOTTY, JUSTIN STEPHENSON


#rhconvergence
Review Legacy Boot Sequence
RHEL5 SysVinit

To summarize, the SysVinit sequence in RHEL5 includes:

System initialization Service startups Accept user login

mingetty
[Link] rc
prefdm

# /etc/init.d/<service> start

5 RED HAT CONFIDENTIAL | BRYAN TOTTY, JUSTIN STEPHENSON


#rhconvergence
Review Legacy Boot Sequence
RHEL6 Upstart
● RHEL6's /sbin/init is an event based job management system called “Upstart.”
● Only the default runlevel is written in /etc/inittab. Various jobs are executed according
to the job configuration files under /etc/init/ on the system startup.
● However, the actual tasks done by those jobs are almost the same as in RHEL5.
If RUNLEVEL=5
Execute /sbin/init

Event "startup" is issued


/etc/init/[Link]
/etc/init/[Link]
Job: "start-ttys"
Job: "rcS"
initctl start tty TTY=$tty
[Link]
telinit $runlevel
/etc/init/[Link]
Event "runlevel X" is issued Job: "prefdm"

/etc/init/[Link] /etc/X11/prefdm -nodaemon

/etc/init/[Link]
Job: "rc"

/etc/rc.d/rc $RUNLEVEL Job: "tty"

/sbin/mingetty TTY
Event "stopped rc" is issued

6 RED HAT CONFIDENTIAL | BRYAN TOTTY, JUSTIN STEPHENSON


#rhconvergence
Review Legacy Boot Sequence
Service startup scripts in RHEL5 and RHEL6
● Service startup scripts /etc/init.d/<service> should accept the following options at
least:

start : Starting the service.


stop : Stopping the service.
status : Replying the service status through the return code.

● Since they are shell scripts, they could accept non-standard options, or could be used for
purposes other than the service(daemon) startup.
● For example,
● PostgreSQL's database cluster initialization (Non-standard option).

# service postgresql initdb

● Running the configuration wizard at the first boot time (Not for service startup).
# service firstboot start

7 RED HAT CONFIDENTIAL | BRYAN TOTTY, JUSTIN STEPHENSON


#rhconvergence
systemd Overview
Objectives of systemd

● Reducing the system startup time


● Handling dynamic system configuration changes
● Providing a standard method for process shutdown
● Controlling the process execution environment

8 RED HAT CONFIDENTIAL | BRYAN TOTTY, JUSTIN STEPHENSON


#rhconvergence
systemd Overview
Unit Types
A Unit in systemd has various types which are indicated by their name extensions. The
followings are some major units:

.service : Service type

When activated, an associated daemon is started.

.target : Target type

Do nothing. This is used to group other units when defining unit dependencies,
or to provide a timing synchronization point when defining order relationships.

.mount : Mount point type

When activated, an associated filesystem is mounted.

.swap : Swap area type

When activated, an associated swap area is enabled.

.device : Device type

When udev recognizes a new device, the associated unit is defined and
activated automatically.

9 RED HAT CONFIDENTIAL | BRYAN TOTTY, JUSTIN STEPHENSON


#rhconvergence
systemd Overview
Unit Types continued
● Some unit types are defined through configuration files.
● These include .service and .target
● Other units are dynamically generated so you won't need to define
them by hand.
● .mount and .swap are automatically generated from /etc/fstab.
● .device is automatically generated by udev.

10 RED HAT CONFIDENTIAL | BRYAN TOTTY, JUSTIN STEPHENSON


#rhconvergence
Managing Units
Basic Unit Operations
# systemctl enable <unit name>
# systemctl disable <unit name>

Enable or disable autostart of the specified unit.

This will define or undefine dependency from the unit specified with WantedBy=
option in the background.

# systemctl start <unit name>


# systemctl stop <unit name>
# systemctl restart <unit name>


Start, stop, or restart the specified unit.
NOTE: reload can be used only when ExecReload= is defined in the unit
configuration file.

11 RED HAT CONFIDENTIAL | BRYAN TOTTY, JUSTIN STEPHENSON


#rhconvergence
Managing Units
Basic Unit Operations continued

# systemctl status <unit name>

● Show the running status of the specified unit.


# systemctl status [Link]
[Link] - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/[Link]; disabled)
Active: active (running) since Sun 2014-01-12 02:34:53 CET; 8s ago
Main PID: 12020 (httpd)
Status: "Processing requests..."
CGroup: /[Link]/[Link]
├─12020 /usr/sbin/httpd -DFOREGROUND
├─12021 /usr/sbin/httpd -DFOREGROUND
├─12022 /usr/sbin/httpd -DFOREGROUND daemon processes of this service
├─12023 /usr/sbin/httpd -DFOREGROUND
├─12024 /usr/sbin/httpd -DFOREGROUND
└─12025 /usr/sbin/httpd -DFOREGROUND

Jan 12 02:34:53 [Link] httpd[12020]: AH00557: httpd: apr_sockadd...


Jan 12 02:34:53 [Link] httpd[12020]: AH00558: httpd: Could not r...
Jan 12 02:34:53 [Link] systemd[1]: Started The Apache HTTP Server.

Recent entries of daemon logs

12 RED HAT CONFIDENTIAL | BRYAN TOTTY, JUSTIN STEPHENSON


#rhconvergence
Managing Units
Listing Unit Files continued
# systemctl list-units

list-units argument can be omitted.
● List currently active (or should be active) units and their statuses.

--type option lists only the specified type.

# # systemctl --type=service
UNIT LOAD ACTIVE SUB DESCRIPTION
[Link] loaded active exited Install ABRT coredump hook
[Link] loaded active running ABRT kernel log watcher
[Link] loaded active running ABRT Xorg log watcher
[Link] loaded active running ABRT Automated Bug Reporting
[Link] loaded active running Accounts Service
[Link] loaded active running Manage Sound Card State (rest
[Link] loaded active running Job spooling tools
[Link] loaded active running Security Auditing Service
[Link] loaded active running Avahi mDNS/DNS-SD Stack

・・・
[Link] loaded active running Daemon for power management

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.

72 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.

13 RED HAT CONFIDENTIAL | BRYAN TOTTY, JUSTIN STEPHENSON


#rhconvergence
Managing Units
Basic Unit Operations continued
# systemctl daemon-reload


Cause systemd to reload configuration files.

You need to run this after modifying a unit configuration file.

Some legacy chkconfig and service commands are translated to the corresponding
systemctl commands.
# chkconfig sshd off
Note: Forwarding request to 'systemctl disable [Link]'.
rm '/etc/systemd/system/[Link]/[Link]'

# chkconfig sshd on
Note: Forwarding request to 'systemctl enable [Link]'.
ln -s '/usr/lib/systemd/system/[Link]' '/etc/systemd/system/[Link]/[Link]'

# service sshd stop


Redirecting to /bin/systemctl stop [Link]

# service sshd start


Redirecting to /bin/systemctl start [Link]


NOTE: Non-standard options in service startup scripts cannot be used with systemd. For example,
instead of running service postgresql initdb like in RHEL6 you should run postgresql-
setup initdb to initialize PostgreSQL in RHEL7. The systemctl command does not allow the
initdb option.

14 RED HAT CONFIDENTIAL | BRYAN TOTTY, JUSTIN STEPHENSON


#rhconvergence
EXERCISE: Systemctl basics
● Start, stop, restart, reload configuration and show status of the
my_little_daemon
# systemctl <action> my_little_daemon.service

● List all units (or just units of a specific type)

# systemctl list-unit-files --type=<type>


● List all failed units

# systemctl list-units --failed


● Get (all) dependencies of the [Link]
# systemctl list-dependencies --all [Link]

● Start multiple services at once

# systemctl start [Link] [Link]


● Show default target, set a new one

# systemctl get-default; systemctl set-default [Link]


● Switch to another target
# systemctl isolate [Link]

15 RED HAT CONFIDENTIAL | BRYAN TOTTY, JUSTIN STEPHENSON


#rhconvergence
Journald Overview
Log management mechanism of systemd

systemd intercepts messages to stdout/stderr and rsyslogd from daemon processes
which have been started as service units.

The messages are sent to its own logging service [Link], or,
journald in short.

journald records those messages in binary files under /var/log/journal/ with adding
some meta information of sender processes.

You can use the journalctl command to search the binary log.

16 RED HAT CONFIDENTIAL | BRYAN TOTTY, JUSTIN STEPHENSON


#rhconvergence
Journald Overview
Log management mechanism of systemd continued

rsyslogd should be configured accordingly.
● In the traditional environment, rsyslogd receives processes' system log messages
through the Unix socket /dev/log.
● Under the systemd environment, systemd receives messages from /dev/log and
sends it again to /run/systemd/journal/syslog.

17 RED HAT CONFIDENTIAL | BRYAN TOTTY, JUSTIN STEPHENSON


#rhconvergence
Journald Overview
Legacy System Log Flow in RHEL6

rsyslogd

/dev/log

Process

18 RED HAT CONFIDENTIAL | BRYAN TOTTY, JUSTIN STEPHENSON


#rhconvergence
Journald Overview
systemd Log Flow in RHEL7

systemd rsyslogd

/dev/log /run/systemd/journal/syslog

Process

19 RED HAT CONFIDENTIAL | BRYAN TOTTY, JUSTIN STEPHENSON


#rhconvergence
Journald Overview
Searching Logs with journalctl
● The followings are major options of journalctl command.

-u <unit name> : Show log messages related to this unit.

--since="YYYY-MM-DD hh:mm:ss" : Show log messages since this date/time.

--until="YYYY-MM-DD hh:mm:ss" : Show log messages until this date/time.
● -b : Show log messages since the last system boot.

-f : Works as tail -f for following the messages when reproducing an issue

--no-pager : Don't use the pager or the less utility to view the messages

-a : Don't cut long messages.

# journalctl -u [Link] -b --no-pager -a


-- Logs begin at Sun 2014-01-12 01:31:34 CET, end at Sun 2014-01-12 03:34:23 CET. --
Jan 12 01:31:50 [Link] systemd[1]: Starting OpenSSH server daemon...
Jan 12 01:31:50 [Link] systemd[1]: Started OpenSSH server daemon.
Jan 12 01:31:51 [Link] sshd[1124]: Could not load host key: /etc/ssh/ssh_host_dsa_key
Jan 12 01:31:51 [Link] sshd[1124]: Could not load host key: /etc/ssh/ssh_host_ecdsa_key
Jan 12 01:31:51 [Link] sshd[1124]: Server listening on [Link] port 22.
Jan 12 01:31:51 [Link] sshd[1124]: Server listening on :: port 22.
Jan 12 02:04:27 [Link] sshd[11662]: error: Could not load host key: /etc/ssh/ssh_host_dsa_key

20 RED HAT CONFIDENTIAL | BRYAN TOTTY, JUSTIN STEPHENSON


#rhconvergence
EXERCISE: Journald
● Latest entries on top


# journalctl -r
● Specific the number of entries displayed

● # journalctl -n 10

● Continuous stream of new entries

● # journalctl -f
● Entries for current boot only

● # journalctl -b

● Entries for a specific unit

● # journalctl -u [Link]
● Entries for a specific PID

● # journalctl _PID=1

21 RED HAT CONFIDENTIAL | BRYAN TOTTY, JUSTIN STEPHENSON


#rhconvergence
EXERCISE: Journald
● Entries for 2 or more specified units/pids


# journalctl _SYSTEMD_UNIT=[Link] _SYSTEMD_UNIT=[Link]
● Entries for a specific binary
# journalctl /usr/bin/screamer

● Connect a pipeline or program's output with the journal

# systemd-cat ls -a

22 RED HAT CONFIDENTIAL | BRYAN TOTTY, JUSTIN STEPHENSON


#rhconvergence
Making Unit Configuration Changes
Unit Configuration Files
● Unit configuration files are placed in two locations:

/etc/systemd/system/ : Admin customized files.


/usr/lib/systemd/system/ : System default files installed from RPM packages.

● If configuration files of the same filename are in both places, one in


/etc/systemd/system is used while the one in /usr/lib/systemd/system is ignored.
● When modifying the system default configuration, you should copy the configuration file in
/usr/lib/systemd/system to /etc/systemd/system, and modify the copied one.

23 RED HAT CONFIDENTIAL | BRYAN TOTTY, JUSTIN STEPHENSON


#rhconvergence
Making Unit Configuration Changes
General [Unit] configuration options

Unit configuration file has multiple sections such as [Unit], [Install], [Service], etc.

[Unit] : Common options for all unit types such as dependency and order.

[Install] : Options related to “systemctl enable/disable” operation.

[Service] : Options specific to the service type.

Each type has its own section in general.

If you need to specify multiple items in the same option, they can be space
separated. You can use the same option multiple times, too.
NOTE: This rule applies to all sections.

Consider these major options in the [Unit] section.
Option Description

Description Short documentation of this unit.


(*) Requires means this unit
Documentation Document URL won't be activated if pre-req
units failed to start.
Requires/Wants(*) Pre-req units of this unit.
Wants means this unit will be
After This unit will be activated after these units. activated even if pre-req units
fails to start.
Before This unit will be activated before these units.

24 RED HAT CONFIDENTIAL | BRYAN TOTTY, JUSTIN STEPHENSON


#rhconvergence
Making Unit Configuration Changes
[Install] options

Major options in [Install] section.
Option Description

WantedBy When enabled, symlink to the configuration files is created under this unit's .wants
directory.

RequiredBy When enabled, symlink to the configuration files is created under this unit's
.required directory.

Also When enabled/disabled, this unit is enabled/disabled, too.


WantedBy and RequiredBy is used to specify pre-req units when autostart is enabled.

/usr/lib/systemd/system/[Link]
[Unit]
Description=OpenSSH server daemon This service is activated after
After=[Link] [Link] [Link] syslog/network/auditd is ready.
[Service]
EnvironmentFile=/etc/sysconfig/sshd
ExecStartPre=/usr/sbin/sshd-keygen
ExecStart=/usr/sbin/sshd -D $OPTIONS
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
This service is enabled as
[Install] a pre-req of [Link]
WantedBy=[Link]

25 RED HAT CONFIDENTIAL | BRYAN TOTTY, JUSTIN STEPHENSON


#rhconvergence
Making Unit Configuration Changes
[service] configuration options continued

Major options in [service] section (1)

Option Description

ExecStart Command to start the service

ExecReload Command to reload the service

ExecStop Command to stop the service

ExecStartPre Additional commands to be executed before/after ExecStart.


ExecStartPost

ExecStopPost Command to be executed when the service stops including the case of abort.

EnvironmentFile Read environment variables from this file.

KillMode Specify how remaining processes are handled after ExecStop.

Type Specify how the service startup is detected. ( Default: simple)

PIDFile PID file of the main process of “fork” type service.

BusName Bus connection name of “D-Bus” type service.

Restart Specify whether the service is restarted when it aborts. ( Default: no)

26 RED HAT CONFIDENTIAL | BRYAN TOTTY, JUSTIN STEPHENSON


#rhconvergence
systemd Overview
Unit Dependency and Order continued

[Link] [Link]

symlink
Services activated
symlink can be
under runlevel 1
changed.

[Link] [Link] [Link] [Link]

Services activated Services activated Services independent Tasks


runlevel
traditionally
に依存せず
under runlevel 5 under runlevel 3 of the runlevel Handled
起動するサービス
by [Link]

[Link]

Mounting
filesystems
[Link]

Enabling swap ares

27 RED HAT CONFIDENTIAL | BRYAN TOTTY, JUSTIN STEPHENSON


#rhconvergence
systemd Overview
Unit Dependency and Order continued

● There are two important concepts


regarding how units interrelate: # systemctl list-dependencies
dependency and order [Link]
├─[Link]
├─[Link]
● Dependency means if unit A is ...snip...
├─[Link]
activated, unit B must be activated, too. └─[Link]
├─[Link]
├─[Link]
● IE: Requires= and Conflicts= ....snip...
├─[Link]
├─[Link]
● Order means unit A must be activated │ ├─[Link]
before/after unit B. │ ├─[Link]
│ ├─[Link]
│ ├─[Link]
....snip....

After= and Before= │ ├─[Link]
│ │ ├─[Link]
● List the dependencies for a particular │ │ ├─[Link]
│ │ ├─[Link]
unit. │ │ ├─[Link]
....snip....
├─[Link]
# systemctl list-dependencies <unit name> │ └─getty@[Link]
....snip....
● This shows which units are pre-reqs of └─[Link]

the specified unit or the “default target”


if no unit name is given.

28 RED HAT CONFIDENTIAL | BRYAN TOTTY, JUSTIN STEPHENSON


#rhconvergence
systemd Overview
Unit Dependency and Order continued
● Unit orders are defined with After= and Before= options in the unit configuration files.
● “After=A B C” means this unit needs to be activated after “A”, “B” and “C”.
● “Before=A B C” means this unit needs to be activated before “A”, “B” and “C”.
● Target units are used to define synchronization points of multiple units.
● For example, [Link] is used as a synchronization point of “units providing
network functions” and “units using network functions”.

Units to use Units to provide


[Link] network functions
network functions
After=[Link] Before=[Link]

/usr/lib/systemd/system/[Link] /usr/lib/systemd/system/[Link]
[Unit] [Unit]
Description=The Apache HTTP Server Description=firewalld - dynamic firewall daemon
After=[Link] [Link] [Link] Before=[Link]
・・・ Before=[Link]
Before=[Link]
・・・

httpd is assured to start


after firewall has been configured.

29 RED HAT CONFIDENTIAL | BRYAN TOTTY, JUSTIN STEPHENSON


#rhconvergence
systemd Overview
Unit Wants

<unit name>.wants directories are used to /usr/lib/systemd/system/[Link]
configure autostartup of services. [Unit]
Description=OpenSSH server daemon
After=[Link] [Link] [Link]
● When autostartup is enabled with the systemctl
[Service]
command, a symlink to the service's EnvironmentFile=/etc/sysconfig/sshd
configuration file is created under the .wants ExecStartPre=/usr/sbin/sshd-keygen
ExecStart=/usr/sbin/sshd -D $OPTIONS
directory specified by WantedBy= option. ExecReload=/bin/kill -HUP $MAINPID
KillMode=process

[Install]
WantedBy=[Link]

Sample of enabling/disabling autostartup of [Link]


# systemctl disable [Link]
rm '/etc/systemd/system/[Link]/[Link]'
# systemctl enable [Link]
ln -s '/usr/lib/systemd/system/[Link]' '/etc/systemd/system/[Link]/[Link]'

# ls -l /etc/systemd/system/[Link]/
total 0
lrwxrwxrwx. 1 root root 46 Oct 30 12:35 [Link] -> /usr/lib/systemd/system/[Link]
lrwxrwxrwx. 1 root root 35 Oct 30 12:36 [Link] -> /usr/lib/systemd/system/[Link]
lrwxrwxrwx. 1 root root 38 Oct 30 12:36 [Link] -> /usr/lib/systemd/system/[Link]
lrwxrwxrwx. 1 root root 44 Oct 30 12:35 [Link] -> /usr/lib/systemd/system/[Link]
lrwxrwxrwx. 1 root root 39 Oct 30 12:36 [Link] -> /usr/lib/systemd/system/[Link]
...snip...
lrwxrwxrwx. 1 root root 36 Nov 27 20:38 [Link] -> /usr/lib/systemd/system/[Link]

30 RED HAT CONFIDENTIAL | BRYAN TOTTY, JUSTIN STEPHENSON


#rhconvergence
EXERCISE: Unit configuration files

● Understanding systemd unit file load path between /etc/systemd/ and /usr/lib

# man [Link] /unit load path


● Helpful information on targets
# man [Link]

● Systemd tree view of dependencies by unit


# systemctl list-dependencies

● View dependencies by showing unit properties


# systemctl show [Link] | egrep 'After|Before'

31 RED HAT CONFIDENTIAL | BRYAN TOTTY, JUSTIN STEPHENSON


#rhconvergence
Managing Units
Listing cgroups

● Systemd creates a cgroup group for each service.

# systemd-cgls
├─[Link]
│ ├─[Link]
│ │ └─[Link]
Subgroup for each user account is │ │ ├─10897 gdm-session-worker [pam/gdm-password]
...snip.....
created under this parent group. │ │ ├─11502 /bin/bash
│ │ ├─11526 su -
│ │ └─11533 -bash
│ └─[Link]
│ └─[Link]
│ ├─11662 sshd: root@pts/1
│ ├─11667 -bash
│ ├─12028 systemd-cgls
│ └─12029 less
└─[Link]
├─1 /usr/lib/systemd/systemd --switched-root --system --deserialize 22
├─[Link]
Subgroup for each unit is created │ ├─12020 /usr/sbin/httpd -DFOREGROUND
│ ├─12021 /usr/sbin/httpd -DFOREGROUND
under this parent group. │ ├─12022 /usr/sbin/httpd -DFOREGROUND
...snip......

32 RED HAT CONFIDENTIAL | BRYAN TOTTY, JUSTIN STEPHENSON


#rhconvergence
Managing Units
Sending signal to process groups
● You can send a process signal to all processes in the same cgroups' group.

# systemctl kill -s9 [Link]

● Send KILL signal (signal# 9) to all processes in the group for [Link].
● You can kill all the processes related to a specific service with this.
● With --kill-who=main option, a signal is sent only to the main process which started
first in the group.
● This mechanism is used when stopping a unit with systemctl stop <unit>, too.

33 RED HAT CONFIDENTIAL | BRYAN TOTTY, JUSTIN STEPHENSON


#rhconvergence
EXERCISE: Cgroups

● View cgroup information with 'ps'


# ps xaf -eo pid,user,args,cgroup
● Show cgroup group tree

# systemd-cgls
● Display resource usage per group in real time

# systemd-cgtop

34 RED HAT CONFIDENTIAL | BRYAN TOTTY, JUSTIN STEPHENSON


#rhconvergence
Convert Legacy Unit/Upstart file
● As an example, we'll convert the init script of the ABRT daemon into a systemd
service file.
● Distill the useful information from the script.
● A description string for the service is "Daemon to detect crashing apps".
● The LSB header[1] contains dependency information. systemd due to its design
around socket-based activation usually needs no (or very little) manually
configured dependencies. In this case the dependency on $syslog (which
encodes that abrtd requires a syslog daemon), is the only valuable information.
While the header lists another dependency ($local_fs) this one is redundant with
systemd as normal system services are always started with all local file systems
available.
● The LSB header suggests that this service should be started in runlevels 3 (multi-
user) and 5 (graphical).
● The daemon binary is /usr/sbin/abrtd

35 RED HAT CONFIDENTIAL | BRYAN TOTTY, JUSTIN STEPHENSON


#rhconvergence
Convert Legacy Unit/Upstart file

[Unit]
Description=Daemon to detect crashing apps
After=[Link]

[Service]
ExecStart=/usr/sbin/abrtd
Type=forking

[Install]
WantedBy=[Link]

36 RED HAT CONFIDENTIAL | BRYAN TOTTY, JUSTIN STEPHENSON


#rhconvergence
The End
Questions?

37 RED HAT CONFIDENTIAL | BRYAN TOTTY, JUSTIN STEPHENSON


#rhconvergence
References

Slide content contributed by Etsuji Nakai <enakai@[Link]> Senior Solutions
Architect at Red Hat

[Link] - systemd System and Service
Manager, Project home of systemd

The systemd for Administrators Blog Series, Blog series by the original developer
Lennart (Links are on the project home.)

Rethinking PID 1. Lennart's blog about the background idea of systemd.
[Link]

Man page systemd is supplemented with useful man pages. In addition to the man
pages for each command, you can follow “SEE ALSO” section of systemd(1).

[Link]

38 RED HAT CONFIDENTIAL | BRYAN TOTTY, JUSTIN STEPHENSON


#rhconvergence

You might also like