Search Our Database

How to Check Service Status Using systemctl status and journalctl in Linux

Last updated on |
by

Introduction

Service management is a fundamental aspect of Linux system administration. Modern Linux distributions that use systemd — including Ubuntu (15.04+), CentOS/RHEL 7+, Debian 8+, Fedora, AlmaLinux, and Rocky Linux — offer powerful tools for interacting with system services. Among these, the systemctl and journalctl commands are central to monitoring and diagnosing services in real time.

The systemctl status command provides a concise summary of a service’s current state, including whether it is active, inactive, failed, or in a transitional state such as starting or stopping. This utility also shows the main process ID (PID), recent log messages, and service load information.

On the other hand, journalctl serves as an advanced logging tool that queries and displays log messages collected by the systemd-journald daemon. It allows administrators to access detailed logs for specific services, users, boot sessions, or time ranges.

This article explains how to check the status of services using systemctl status, how to retrieve detailed logs using journalctl, and how to interpret the results effectively.

 

Prerequisites

  • A Linux system running systemd (e.g., Ubuntu 20.04+, CentOS 7+, Debian 10+, AlmaLinux 8+)
  • Terminal access with root or sudo privileges
  • The target service must be installed and managed by systemd

 

Step-by-step Guide

Step 1: Check Service Status with systemctl status

To view the current status of a service (e.g., nginx ):

sudo systemctl status nginx

This output includes:

  • Service state (active, inactive, failed)

  • Uptime and start time

  • Loaded unit file path

  • Main PID and memory usage

  • Last few log entries from the journal

🖊️ Tip: If unsure of the exact service name, use systemctl list-units –type=service to list all active services.

 

Step 2: Use systemctl is-active and is-enabled for Script-Friendly Checks

For simplified status checks in scripts:

systemctl is-active nginx

This returns active, inactive, or failed.

Check if a service is enabled to start at boot:

systemctl is-enabled nginx

Output will be enabled, disabled, or static

 

Step 3: View Service Logs with journalctl -u

To display all logs for a specific service unit:

sudo journalctl -u nginx

🖊️ Tip: Add –no-pager to avoid pagination or –lines=50 to limit output.

 

To see logs from the current boot only:

sudo journalctl -u nginx --since "today"

Or specify time ranges:

sudo journalctl -u nginx --since "2025-07-23 08:00" --until "2025-07-23 10:00"

 

Step 4: Follow Real-time Logs Using journalctl -f

To view logs as they are generated (similar to tail -f):

sudo journalctl -u nginx -f

This is especially useful when monitoring a service restart or a long-running operation.

 

Step 5: Check Recent Failures Across All Services

To find failed services system-wide:

systemctl --failed

This lists all units that have failed along with their descriptions and load state.

For deeper insight, combine it with journalctl:

sudo journalctl -xe

This displays critical logs, often useful when diagnosing why a service failed to start.

⚠️ Warning: Frequent use of journalctl -xe may overwhelm with messages; refine the query when possible.

 

Conclusion

Using systemctl status and journalctl effectively is key to monitoring and diagnosing services on systemd-based Linux distributions. The systemctl command offers quick insights into service status, while journalctl provides detailed logs for auditing and troubleshooting.

Should you have any inquiries about the guidelines, please feel free to open a ticket through your portal account or contact us at support@ipserverone.com. We’ll be happy to assist you further.