linux-systemd-services
Retrieves a list of systemd service units on the Linux system. Runs systemctl -at service to return the load status, active status, and sub-status of all services as structured fields.
Command properties
| Item | Description |
|---|---|
| Command type | Driver query |
| Required permission | Administrator |
| License usage | Licensed command |
| Parallel execution | Not supported |
| Distributed execution | Runs on Data Node (mapper) |
Syntax
Output fields
| Field | Type | Description |
|---|---|---|
service | string | Service unit name |
load_status | string | Service load status. Takes values such as loaded, not-found, masked, etc. |
active_status | string | Service active status. Takes values such as active, inactive, failed, etc. |
sub_status | string | Service sub-status. Represents the detailed state of the active status, such as running, exited, dead, waiting, failed, etc. |
Error codes
Parse errors
| Error code | Message | Description |
|---|---|---|
95040 | no-read-permission | Occurs when a user without administrator privilege runs the command |
Runtime errors
N/A
Description
The linux-systemd-services command runs systemctl -at service to collect the status of all systemd service units registered on the system. The -at service option displays all units of the service type regardless of whether they are loaded.
The command skips the first line (header) of the output and splits each line by whitespace until an empty line appears, extracting the service unit name, load status, active status, and sub-status.
Examples
-
Retrieve all systemd services
linux-systemd-servicesRetrieves the status of all systemd service units registered on the system.
-
Retrieve only running services
linux-systemd-services | search sub_status == "running"Filters and retrieves only currently running systemd services.
-
Retrieve failed services
linux-systemd-services | search active_status == "failed"Filters and retrieves services whose active status is
failed.