Date post: | 08-Feb-2017 |
Category: | Technology |
View: | 14,257 times |
Download: | 2 times |
Systemd Usage Guide on RHEL 7
i | P a g e
Table of Contents Overview ....................................................................................................................................................... 1
Applies To .................................................................................................................................................. 1
Pre-Requisites ........................................................................................................................................... 1
Systemd Generic Information .................................................................................................................... 1
Version ...................................................................................................................................................... 1
Binaries...................................................................................................................................................... 1
Process System.......................................................................................................................................... 2
Systemd Units ............................................................................................................................................ 2
Systemd Boot Process ................................................................................................................................ 3
Analyze systemd Boot Process ............................................................................................................... 3
Analyze systemd Each Boot Process ...................................................................................................... 4
Analyze systemd Critical Chain at Boot .................................................................................................. 5
Analyze systemd Critical Chain by Service Unit ..................................................................................... 6
Analyze systemd Critical Chain by Target .............................................................................................. 6
Systemd Units Commands ............................................................................................................................ 7
List Units Available ................................................................................................................................. 7
List Units Running .................................................................................................................................. 8
List Units Failed ...................................................................................................................................... 8
List Units By Type Service ....................................................................................................................... 9
List Units By Type Mount ....................................................................................................................... 9
List Units By Type Socket ..................................................................................................................... 10
List Units By Type Slice ......................................................................................................................... 10
List Units By Type Swap........................................................................................................................ 11
List Units By Type Snapshot ................................................................................................................. 11
List Units By Type Path ......................................................................................................................... 11
List Units By Type Timer ....................................................................................................................... 12
So Whats systemctl / systemd unit Files .................................................................................................... 12
List Service All Properties ..................................................................................................................... 13
List Service Specific Property - CPUShares ........................................................................................... 13
List Service Specific Property - CanReload ........................................................................................... 14
List Service Specific Property - Conflicts .............................................................................................. 14
Systemd Usage Guide on RHEL 7
ii | P a g e
Service Dependencies ................................................................................................................................. 14
List Dependencies ................................................................................................................................... 15
List Service Dependencies by Service ..................................................................................................... 16
List Dependencies by Target ................................................................................................................... 16
List Service Dependencies For Service ................................................................................................. 17
List Service Dependencies Before ........................................................................................................ 17
List Service Dependencies After ........................................................................................................... 18
List Service Dependencies Reverse ...................................................................................................... 18
List Service Dependencies Target ........................................................................................................ 19
List Service Dependencies Plot ............................................................................................................ 19
Systemd Usage Guide on RHEL 7
1 | P a g e
Overview
Systemctl is a systemd utility which is responsible for controlling the systemd system and service manager.
Systemd is a collection of system management daemons, utilities and libraries which serves as a
replacement of SystemV init daemon.
Systemd functions as central management and configuration platform for UNIX like system.
Applies To
Tested on RHEL 7, CentOS 7.
Pre-Requisites
None
Systemd Generic Information
Version
To find the version of systemctl executable, run the command;
systemctl --version
Binaries
To find the binaries of systemctl executable, run the command;
whereis systemctl
Systemd Usage Guide on RHEL 7
2 | P a g e
Process System
To know the process associated with systemd run the command;
ps -eaf | grep [s]ystemd
Systemd Units
There are different units that are managed by systemd and it accepts following units.
Systemctl Units Purpose
systemd.service Manage System Service; A unit configuration file whose name ends in .service encodes information about a process controlled and supervised by systemd.
systemd.socket Manage sockets for each service; A unit configuration file whose name ends in ".socket" encodes information about an IPC or network socket or a file system FIFO controlled and supervised by systemd, for socket-based activation.
systemd.device Manage devices; A unit configuration file whose name ends in ".device" encodes information about a device unit as exposed in the sysfs/udev device tree.
systemd.mount Manage mount points; A unit configuration file whose name ends in ".mount" encodes information about a file system mount point controlled and supervised by systemd.
systemd.target Manage targets; A unit configuration file whose name ends in ".target" encodes information about a target unit of systemd, which is used for grouping units and as well-known synchronization points during start-up. Target units do not offer any additional functionality on top of the generic functionality provided by units. They exist merely to group units via dependencies (useful as boot targets), and to establish standardized names for synchronization points used in dependencies between units. Among other
Systemd Usage Guide on RHEL 7
3 | P a g e
things, target units are a more flexible replacement for SysV runlevels in the classic SysV init system.
systemd.paths Check the existence of files or directories or create them as needed
systemd.slices Manage resources
systemd.snapshots Takes snapshots of the current state of the system
systemd.sockets Set up sockets to allow communication paths to processes that can remain in place, even if the underlying process needs to restart
systemd.swaps Create and use swap files or swap partitions
Systemd.timer Trigger actions based on a timer
Systemd Boot Process
systemd is the first process started by the kernel. It replaces the venerable SysVinit program (also
called init) and the newer Upstart init system. systemd coordinates the rest of the boot process and
configures the environment for the user.
systemd improves on other init systems with increased parallelization. It
Click here to load reader