Start, stop, and check the status of network services

4. Operate Running Systems

πŸ“˜Red Hat Certified System Administrator (RHCSA – EX200)


This section is very important for the RHCSA (EX200) exam. In the exam, you may need to manage network services on a running system. You must know how to start, stop, restart, enable, disable, and check the status of services.

In Red Hat Enterprise Linux, services are managed by:

  • systemd (the init system)
  • The main command used: systemctl

You must be comfortable using these commands.


1. What is a Network Service?

A network service is a program that:

  • Runs in the background (daemon)
  • Waits for network requests
  • Provides services to other systems or users

Examples of network services in an IT environment:

  • A web server serving websites
  • An SSH server allowing remote login
  • A firewall service controlling traffic
  • A time synchronization service
  • A DNS server resolving domain names

These services run continuously in the background.


2. Understanding systemd and systemctl

In Red Hat Enterprise Linux 8/9, services are controlled by systemd.

The command used to manage services is:

systemctl

Services are controlled using unit files, usually located in:

/usr/lib/systemd/system/

Service files end with:

.service

For example:

sshd.service

When using systemctl, you usually do not need to type .service.


3. Start a Network Service

To start a service immediately:

sudo systemctl start service_name

Example:

sudo systemctl start sshd

This:

  • Starts the SSH server immediately
  • Does NOT enable it at boot

In the exam:

  • If a task says β€œStart the service now”, this is the correct command.

4. Stop a Network Service

To stop a running service:

sudo systemctl stop service_name

Example:

sudo systemctl stop sshd

This:

  • Stops the service immediately
  • It will no longer accept connections

5. Restart a Network Service

To restart a service:

sudo systemctl restart service_name

Example:

sudo systemctl restart sshd

This:

  • Stops the service
  • Starts it again

You usually restart a service after:

  • Changing configuration files
  • Applying new settings

6. Reload a Service (Very Important)

Some services support reload without fully restarting:

sudo systemctl reload service_name

Example:

sudo systemctl reload sshd

Reload:

  • Applies configuration changes
  • Does NOT completely stop the service

If reload is not supported, you must use restart.

To check if reload is supported:

systemctl status service_name

Look for “can reload”.


7. Check Service Status

To check whether a service is running:

systemctl status service_name

Example:

systemctl status sshd

Output shows:

  • Loaded (enabled/disabled)
  • Active (running/stopped/failed)
  • Process ID (PID)
  • Recent log messages

Important status values:

StatusMeaning
active (running)Service is working
inactiveService is stopped
failedService crashed or error

In the exam:
You must understand whether a service is running or not.


8. Enable a Service at Boot

To make a service start automatically at boot:

sudo systemctl enable service_name

Example:

sudo systemctl enable sshd

This:

  • Creates symbolic links
  • Ensures service starts when the system boots

To verify:

systemctl is-enabled sshd

Output:

  • enabled
  • disabled

9. Disable a Service at Boot

To prevent a service from starting at boot:

sudo systemctl disable service_name

Example:

sudo systemctl disable sshd

This does NOT stop it immediately.
It only prevents auto-start at next boot.


10. Start and Enable at the Same Time

Very useful for the exam:

sudo systemctl enable --now service_name

Example:

sudo systemctl enable --now sshd

This:

  • Starts the service immediately
  • Enables it at boot

11. Check All Services

To list all active services:

systemctl list-units --type=service

To list all services (including inactive):

systemctl list-unit-files --type=service

12. Mask and Unmask a Service (Advanced but Exam-Relevant)

To completely block a service from starting:

sudo systemctl mask service_name

This:

  • Prevents starting manually
  • Prevents starting at boot

To allow it again:

sudo systemctl unmask service_name

13. Common Network Services in RHCSA

You should recognize these:

ServicePurpose
sshdRemote login
firewalldFirewall management
chronydTime synchronization
httpdWeb server
vsftpdFTP server
NetworkManagerNetwork configuration

You may need to start or enable them during the exam.


14. Check if a Service is Listening on a Port

In real IT environments, after starting a service, you must verify that it is listening.

Use:

ss -tuln

Or:

ss -tulnp

This shows:

  • Listening ports
  • Associated services

Example:

  • SSH listens on port 22
  • HTTP listens on port 80

This is very important in troubleshooting.


15. Troubleshooting a Failed Service

If a service fails:

Step 1: Check status

systemctl status service_name

Step 2: Check logs

journalctl -u service_name

This shows detailed error messages.


16. Difference Between Active and Enabled

This is a common exam confusion.

TermMeaning
ActiveRunning now
EnabledWill start at boot

A service can be:

  • Active but not enabled
  • Enabled but not currently running
  • Disabled and inactive

You must understand this clearly.


17. Targets (Replacement for Runlevels)

Older Linux used runlevels.
Now systemd uses targets.

Example:

systemctl get-default

Common target:

multi-user.target

Network services usually run in multi-user target.


18. Exam Tips for RHCSA

For this section, you must be able to:

βœ” Start a service
βœ” Stop a service
βœ” Restart a service
βœ” Reload a service
βœ” Enable a service at boot
βœ” Disable a service
βœ” Check status
βœ” Verify service is listening
βœ” Troubleshoot using journalctl

Practice these commands many times.


19. Step-by-Step Example Scenario (Exam Style)

If the exam says:

Ensure the SSH service is running and enabled at boot.

You should do:

sudo systemctl enable --now sshd

Then verify:

systemctl status sshd
systemctl is-enabled sshd

20. Important Summary Commands

systemctl start service
systemctl stop service
systemctl restart service
systemctl reload service
systemctl status service
systemctl enable service
systemctl disable service
systemctl enable --now service
systemctl is-enabled service
systemctl mask service
systemctl unmask service
journalctl -u service
ss -tulnp

You must remember all of these for the exam.


Final Advice for RHCSA Students

This topic is practical. In the exam:

  • You will not get multiple choice questions.
  • You must actually perform these tasks.
  • Typing mistakes will cost marks.
  • Always verify after making changes.

Practice on a RHEL 8 or 9 system repeatedly until you are fully comfortable.

Buy Me a Coffee