Linux Classroom Series – 03/Aug/2020

SYSTEMD

  • At its core systemd is a system and startup manager. This has replaced traditional tools and subsystems
    • init
    • telinit
    • inittab
    • SysV
    • upstart
  • Project Page link
  • systemd is a suite of basic building blocks for a Linux System. It provides system and service manager that runs as PID1 and starts the rest of the system Preview
  • system provides aggressive parallelization capabilities uses socket and D-Bus activation for starting services.
  • Role:
    • systemd manages various system startup & shutdown functions. It also maintains startup and shutdown of services (daemon) on Linux OS.
    • systemd can monitor the services throughout the lifetime.
  • Systemd also no longer uses traditional shell scripts to store the configuration information for services which have been replaced by simple configuration files.
  • The objects that systemd manages are called as units & they are building blocks of systemd. Objects can be
    • services or daemons
    • devices
    • file system entries
  • Standard unit configurations are stored under /usr/lib/systemd/system Preview
  • Any new unit files as well as any needed customizations to existing unit files should be copied over to /etc/systemd/system for actual usage.
  • The following types of units exists
  • Service units: The units include traditional system daemons or services, These daemons can be started, stopped, restart, reloaded & enabled.
    • Service units are stored with .service extensions in /etc/systemd/system
    ls -al *.service
    
  • Socket units: These units consists of local and network sockets that are used for inter process communication in a system.
    • Socket units are stored with .socket extensions int /etc/systemd/system
    ls -al *.socket
    
  • Device units: These units allow systemd to see & use kernel devices.
    • Device units are stored with .device extensions int /etc/systemd/system
    ls -al *.device
    
  • Mount units: These units are used for mounting and unmounting file systems
    • Mount units are stored with .mount extensions int /etc/systemd/system
    ls -al *.mount
    
  • Target units: systemd uses target units for logical grouping of units.
    • target units are stored with .target extensions int /etc/systemd/system
    ls -al *.target
    
  • Timer units: These units are used for triggering activations of other units base on timers.
    • timer units are stored with .timer extensions int /etc/systemd/system
    ls -al *.timer
    
  • Snapshot unit: These units are used to save the state of set of systemd units temporarily.
    • snapshot units are stored with .snapshot extensions int /etc/systemd/system
    ls -al *.snapshot
    
  • Systemctl commandline for viewing units
sudo systemctl list-units --type=target
sudo systemctl list-units --type=mount --all
sudo systemctl list-units --all
sudo systemctl is-enabled sshd.service
sudo systemctl start NAME.service
sudo systemctl enable NAME.service
sudo systemctl stop NAME.service
sudo systemctl disable NAME.service

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About learningthoughtsadmin