Show Menu

Systemd Cheat Sheet by

systemd     init

Features

Socket­-based activation
Bus-based activation
Device­-based activation
Path-based activation
Mount and automount point management
Aggressive parall­eli­zation
Transa­ctional unit activation logic
Backwards compat­ibility with SysV init

Config­uration

/etc­/sy­ste­md/­sys­tem.conf override default config­uration

Unit Types

.ser­vice A system service
.tar­get A group of systemd units
.aut­omo­unt A file system automount point
.dev­ice A device file recognized by the kernel
.mount A file system mount point
.path A file or directory in a file system
.scope An externally created process
.slice A group of hierar­chi­cally organized units that manage system processes
.sna­pshot A saved state of the systemd manager
.soc­ket An inter-­process commun­ication socket
.swap A swap device or a swap file
.timer A systemd timer

Unit File Locations

/usr­/li­b/s­yst­emd­/sy­stem/ Systemd unit files distri­buted with installed packages
/run­/sy­ste­md/­sys­tem/ Systemd unit files created at run time
/etc­/sy­ste­md/­sys­tem/ Systemd unit files for extending a service

Logs

jour­nalctl -b show all messages from this boot
jour­nalctl -b -1 show all messages from previous boot
jour­nalctl --sinc­e="2­012­-10-30 18:17:­16" show all messages from date and optional time
jour­nalctl --since "20 min ago" show all messages since 20 minutes ago
jour­nalctl -f show new messages
jour­nalctl /usr/l­ib/­sys­tem­d/s­yst­emd show all messages by a specific executable
jour­nalctl _PID=1 show all messages by a specific process
jour­nalctl -u man-db.se­rvice show all messages by a specific unit
jour­nalctl -k show kernel ring buffer:
jour­nalctl -p err..a­lert Show only error, critical, and alert priority messages
jour­nalctl SYSLOG­_FA­CIL­ITY­=10 show auth.log equivalent by filtering on syslog facility
jour­nalctl --file /var/l­og/­jou­rna­l/*­/sy­ste­m.j­ournal -f force journalctl to look only into most recent journal
jour­nalctl --vacu­um-­siz­e=1­00M remove archived journal files until the disk space they use falls below 100M
jour­nalctl --vacu­um-­tim­e=2­weeks make all journal files contain no data older than 2 weeks
 

Services

syst­emctl list-units --type service list all currently loaded service units
syst­emctl list-units --type service --all list all loaded service units regardless of their state
syst­emctl list-u­nit­-files --type service list all available service units to see if they are enabled
syst­emctl status name.s­er­vice show detailed inform­ation about a service unit
syst­emctl is-active name.s­er­vice verify a particular service unit is running
syst­emctl is-enabled name.s­er­vice verify a particular service unit is enabled
syst­emctl list-d­epe­nde­ncies --after name.s­er­vice show units ordered to start before a service unit
syst­emctl list-d­epe­nde­ncies --before name.s­er­vice show units ordered to start after a service unit
syst­emctl start name.s­er­vice start a service unit
syst­emctl stop name.s­er­vice stop a service unit
syst­emctl restart name.s­er­vice restart a service unit
syst­emctl try-re­start name.s­er­vice restart a service unit if corres­ponding service running
syst­emctl reload name.s­er­vice reload service unit config­uration file
syst­emctl enable name.s­er­vice enable service unit
syst­emctl reenable name.s­er­vice reenable service unit
syst­emctl disable name.s­er­vice disable service unit
syst­emctl mask name.s­er­vice mask service unit to prevent from being started
syst­emctl unmask name.s­er­vice unmask a service unit
syst­emctl daemon­-re­load notify new service file exists
syst­emd­-de­lta show overridden units

Locale

loca­lectl status show current status
loca­lectl list-l­oca­les list available locales
localectl set-locale LANG=­loc­ale set new locale
loca­lectl list-k­eym­aps list available keymaps
loca­lectl set-keymap map set new keymap
loca­lectl set-x1­1-k­eymap map set console and x11 keymap
loca­lectl --no-c­onvert set-x1­1-k­eymap map set x11 keymap

Date and Time

time­dat­ectl show current date and time
time­datectl set-time HH:MM­:SS change current time
time­datectl set-lo­cal-rtc boole­an set clock in local time
time­datectl set-time YYYY-­MM-­DD change current date
time­datectl list-t­ime­zones list all available time zones
time­datectl set-ti­mezone time_­zone set new timezone
time­datectl set-ntp boole­an set or unset NTP service
 

Targets

powe­rof­f.t­arget shut down and power off the system
resc­ue.t­ar­get set up rescue shell
mult­i-u­ser.ta­rget set up non graphical multi user system
grap­hic­al.t­ar­get set up graphical multi user system
rebo­ot.t­ar­get shutdown and reboot the system
syst­emctl list-units --type target lists currently loaded target units
syst­emctl list-units --type target --all lists all loaded target units
syst­emctl isolate name.t­ar­get changes the current target
syst­emctl get-de­fault view default target
syst­emctl set-de­fault name.t­ar­get set desired target
syst­emctl isolate name.t­ar­get change current to desired target
syst­emctl rescue change current target and enter rescue mode
syst­emctl --no-wall rescue change current target and enter rescue mode
syst­emctl emerge­ncy change the current target and enter emergency mode
syst­emctl --no-wall emerge­ncy change the current target and enter emergency mode

Power Management

syst­emctl halt halts the system
syst­emctl poweroff powers off the system
syst­emctl reboot restarts the system
syst­emctl suspend suspends the system
syst­emctl hibern­ate hibernates the system
syst­emctl hybrid­-sl­eep hibernates and suspends the system

Download the Systemd Cheat Sheet

2 Pages
//media.cheatography.com/storage/thumb/misterrabinhalder_systemd.750.jpg

PDF (recommended)

Alternative Downloads

Share This Cheat Sheet!

 

Comments

No comments yet. Add yours below!

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.

          Related Cheat Sheets

          systemd Cheat Sheet
          Journalctl Cheat Sheet

          More Cheat Sheets by misterrabinhalder

          RPM Cheat Sheet