Bookmark this page

Guided Exercise: Using systemctl to Manage Services

In this lab, you will manage a service unit that is already installed on the system.

Outcomes

The chronyd service is disabled and no longer running on the system.

Reset your serverX system.

  1. Observe the results of systemctl restart and systemctl reload commands.

    1. Display the status of the sshd service. Note the process ID of the daemon.

      [student@serverX ~]$ systemctl status sshd
    2. Restart the sshd service and view the status. The process ID of the daemon has changed.

      [student@serverX ~]$ sudo systemctl restart sshd
      [student@serverX ~]$ systemctl status sshd
    3. Reload the sshd service and view the status. The process ID of the daemon has not changed and connections have not been interrupted.

      [student@serverX ~]$ sudo systemctl reload sshd
      [student@serverX ~]$ systemctl status sshd
  2. Verify that the chronyd service is running.

    [student@serverX ~]$ systemctl status chronyd
  3. Stop the chronyd service and view the status.

    [student@serverX ~]$ sudo systemctl stop chronyd
    [student@serverX ~]$ systemctl status chronyd
  4. Determine if the chronyd service is enabled to start at system boot.

    [student@serverX ~]$ systemctl is-enabled chronyd
  5. Reboot the system, then view the status of the chronyd service.

    [student@serverX ~]$ systemctl status chronyd
  6. Disable the chronyd service so that it does not start at system boot, then view the status of the service.

    [student@serverX ~]$ sudo systemctl disable chronyd
    [student@serverX ~]$ systemctl status chronyd
  7. Reboot the system, then view the status of the chronyd service.

    [student@serverX ~]$ systemctl status chronyd
Revision: rh124-7-1b00421