Working with systemd

Systemd is the new daemon/service management for Linux.
It is simpler from previous service management and very flexible.
Basic command:

    • systemctl list-units
      will show list of all services (and more)
      if we want to see only services:
      systemctl list-units | grep service
    • systemctl status <serviceName>
      will show the status of serviceName
    • systemctl start <serviceName>
      will start serviceName
    • systemctl enable <serviceName>
      make the service to start automatically  next time system boot
    • systemctl --failed
      show all the services that failed to start.
    • systemctl is-enabled <serviceName>
      tell us if the service is enabled (will start automatically when machine start)
    • systemctl suspend
      will suspend the system (information still in RAM).
    • systemctl hibernate
      will hibernate the system.
    • systemctl list-units --type=target
      will show you all the current active targets, the target is equivalent to runlevel.
      But you can have more than one active target.

      •  run level 3 is multi-user.target.
      • run level 5 is graphical.target
    • journalctl -b
      show all log from the last boot.
    • journalctl -u <serviceName>
      show all log for serviceUnit service
    • systemctl daemon-reload
      Reload the systemd manager configuration. Should be run after creating or changing systemd configuration files, like service files.

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s