top of page
Motherboard

Service Management

In RHEL, you can manage services using systemctl, which allows you to start, stop, restart, enable, and check the status of systemd services. Additionally, you can find and manage running processes using their Process ID (PID) with commands like ps aux, pgrep <service-name>, or kill <PID> for manual control over service-related processes.

RHEL Service Administration

systemctl is a command-line tool used to manage systemd services on Linux, allowing you to start, stop, restart, enable, and disable services. It also provides status information, logs, and dependency management for system services and targets.

You can view a process ID (PID) and its resource usage using ps aux or top, which display CPU, memory, and other details. For a real-time view, htop provides an interactive interface to monitor and manage processes efficiently.

You can view service logs using journalctl -u <service-name>, which displays logs for a specific systemd service. For real-time monitoring, use journalctl -fu <service-name> to continuously stream new log entries.

htop is an interactive process viewer for Linux that provides a real-time, color-coded display of system resource usage, including CPU, memory, and running processes. It offers an intuitive interface with sorting, filtering, and process management features, making it a more user-friendly alternative to top.

systemclt Commands

View Service Details

systemctl status firewalld

systemclt.png

Manage Services

Start a Service

Stop a Service

Soft Kill by Process ID

Hard Kill by Process ID

sudo systemctl start firewalld

sudo systemctl start firewalld

sudo kill 888

sudo kill -9 888

Service Dependancies

systemctl show NetworkManager.service | grep -E 'Requires=|After=|Wants='

dep.png

You can then query the required services to see if they are running...

dep1.png

ViewServices

systemctl --type=service --state=running | sort

view_services.png

PS

Check Process Memory Usage (KB):

ps -eo pid,user,s,comm,size,vsize,rss --sort -size | head -1; ps -eo pid,user,s,comm,size,vsize,rss --sort -size | grep firewalld

PID01.png

Check Process Usage:

ps aux | head -1; ps aux | grep 888

PID02.png

htop

Viewing with htop

​

Enable Required Repositories:

sudo subscription-manager repos --enable codeready-builder-for-rhel-9-$(arch)-rpms

​

Install EPEL:

sudo dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm

​

Install htop

sudo dnf install -y htop

just run the command htop

htop.png

journalctl

You can see the logs for specific service. These are great for troubleshooting.

sudo journalctl -u NetworkManager.service

journalctl1.png
bottom of page