-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

How SysV and upstart have been replaced

Big changes have landed with el7 and they are going to affect you and the way you work. This is an overview of the functionalities of systemd.

Description :

Backwards compatible with SysV init scripts, Systemd is the new service and system manager for CentOS 7. It also provides features like parallels startup of system services at boot time, system state snapshots support, on-demand activation of daemons.
Systemd introduces the concept of units, that encapsulate information about services, sockets, saved system state snapshots. See following table for details.

Unit Type File Extension Description
Service unit .service A system service.
Target unit .target A group of systemd units.
Automount unit .automount A file system automount point.
Device unit .device A device file recognized by the kernel.
Mount unit .mount A file system mount point.
Path unit .path A file or directory in a file system.
Scope unit .scope An externally created process.
Slice unit .slice A group of hierarchically organized units that manage system processes.
Snapshot unit .snapshot A saved state of the systemd manager.
Socket unit .socket An inter-process communication socket.
Swap unit .swap A swap device or a swap file.
Timer unit .timer A systemd timer.

Services
Changing/querying service status:

systemctl start/stop/restart/try-restart/reload/status/is-active servicename.service

Changing/querying on boot service loading status:

systemctl enable/disable/status/is-enabled servicename.service

Please note that a service can be started manually or by dependency from another service. In order to prevent or allow this, use the following:

systemctl mask/unmask servicename.service

Please note that .service is not required

Init levels
Displaying the default target:

systemctl get-default
multi-user.target

List different targets:

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
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.target      loaded active active Network
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
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.

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

Switch to single mode:

systemctl rescue

System status:

Halting the system:
systemctl halt
Power Off the system:
systemctl poweroff
 Reboot:
systemctl reboot
Suspend the system:
systemctl suspend
Hibernate the system:
systemctl hibernate
Hibernate and suspend system:
systemctl hybrid-sleep
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJW5eRNAAoJEBeKS2x6xuR7gAkP/0aFRLZ9AdA+WCdViRfAVJGx
LqwmOT3v/cFrzBHfql93Xzyp8kcd2O/BAkVFI39W0q5ux/8JT71VYGnZLK19eF1t
5t6rc8B64+qZ1pikX+fyxbXMhyXN8YhiJrkRXNECtBdOSscGgHWhH7tHVNOrNRl9
FjS1g65UrTztz1ntMZEwpNWoT94wbejdw0KCa5BPpdI0dw3R9gYe0LVmFsM0BQHH
srVvvIXspJ7zy2o+748EtAvrUHp6NuEAmp9GVd4giKYCCtGVxnwofFRui5b5CfAv
5bcDE1cu1t0KU0ZV/VdaOxtmuibo9m2clmDOqgKVP76JiLvzuH8KNWxqQnn3fYLj
vEdf9egoj+omUUZZ8aRgvM0ILPAbziDqLTgXk+fqKe1tyGo27/H+VLI5tgYlgGEB
jkesCu1QeN7Gj2VA3b11WKgAPYwUTNidd3hJxMlqoS2E6p/XVx3WYqrZRixC+457
BC1fo+MUVtlBikJrLmg7sylef0rCgMMiV72X0XepuIqSDolTAQaL4IvxTaHtsAwO
zjjfvTaLaUb2f93nTREdt/4wALJxmpXO+M1ge208gCsjH7k3NhMaeXsXMK7HGh98
DadkAxE917aRGO6xovl7zXhQvwsZDu2Ul/dLqalbHTmbuSXlkbCXdyTHeOWeYexk
a/rwMU+NNUM6XQVp6o6u
=yyZG
-----END PGP SIGNATURE-----

Hint: To validate signature, please view page source and copy html code between BEGIN PGP Signed message and END PGP Signature anchors.

Created the 2014-06-17

Share this


Resources

10 last articles

blog comments powered by Disqus