GoAdmio

status

Collect the status of the loaded systemd services (running, exited, and failed) into GoAdmio's status database and print them

On this page: Overview · Quick start · Syntax · Options · Output · Examples · Troubleshooting · Details · See also


Overview

/go/status takes a snapshot of the services that systemd currently has loaded on the server, such as the web server, PHP-FPM, MariaDB, and mail services. It:

It is a snapshot of the moment it runs. It does not watch services or restart anything. For automatic repairs, see heal.

Services that are stopped and not failed are not listed, because systemd leaves them out of its default list.


Quick start

/go/status

Syntax

/go/status
Form Behavior
/go/status Collects, prints, and stores the status of the loaded services.

Options

This command has no options. Arguments are only written to the log file.


Output

Each service is printed as one line in this format:

<service> | <status> | <description>

An illustrative example:

sshd | loaded active running | OpenSSH server daemon
mariadb | loaded active running | MariaDB database server
cron | loaded active running | Command Scheduler
firewalld | loaded active running | firewalld - dynamic firewall daemon
systemd-user-sessions | loaded active exited | Permit User Sessions

The status column holds the three systemd states: whether the unit file was loaded, the high-level state (active or failed), and the low-level state (running, exited, or failed).

Status Meaning
loaded active running The service is running.
loaded active exited The service ran and finished, which is normal for one-time start-up tasks.
loaded failed failed The service tried to start and failed.

The command prints nothing else. The same list is also saved in GoAdmio's status database, and every run is recorded in /var/log/go/status.log.


Examples

# Collect and show the status of the loaded services
/go/status
# Show only the failed services
/go/status | grep failed
# Look at one service in detail with systemd itself
systemctl status mariadb

Troubleshooting

Symptom Likely cause Fix
A service is missing from the list It is stopped and not failed, so systemd does not list it. Check it with systemctl status <service>.
The list in GoAdmio is empty or short The stored list is emptied at the start of each run and refilled one row at a time, so it looks incomplete while the command runs, or if the command stopped half way. Run the command again and wait for it to finish.
The status column holds a description The service is in another state, such as activating or auto-restart, and the line is not split correctly. Check it with systemctl status <service>.
A description is cut off or has a ` ` in it The text replacements also change the descriptions (see How the lines are split).
A service is printed but missing from the stored list Its description has an apostrophe, which makes the database insert fail for that line. None. Use systemctl for that service.
Lines for sockets or other units appear The filter keeps any line with "service" in it, even in the description. None.
The list is out of date The list is a snapshot from the last run. Run the command again.
sqlite3: command not found sqlite3 is not installed. Install it.

Details

What it does

  1. Writes the command and its arguments to /var/log/go/status.log.
  2. Empties the Status table in /var/lib/sqlite/status.db.
  3. Saves the list of systemd units that contain "service" to the temporary text file /usr/local/goadmio/tmp/status.db (a plain text file, not a database).
  4. Rewrites that file so that the fields are separated by |.
  5. Reads each line and splits it into service, status, and description.
  6. Prints the line, then inserts it into the Status table with a sort number that counts up from 21, so the order is kept.

How the lines are split

The script turns the systemd output into |-separated text with a series of replacements:

Replacement Purpose
Any character followed by service becomes ` `
loaded , active , failed , running , exited get a ` ` after them
The ● marker is removed The marker systemd puts before failed units.

These replacements apply to the whole line, including the description. The first one also matches any character before the word service, so the text service inside a description can be cut out. Only the first five fields are used, so text after an extra | is dropped.

What is listed

The list comes from systemctl with no options, which shows units that are loaded and active, or that have failed. Stopped units are not shown. Lines are then kept if they contain a character followed by service, which includes lines whose description mentions "service".

Other notes


See also

Command Description
heal Monitor key services, memory, load, and disk, and automatically fix problems (Auto-Heal)
web Restart or reload the active web server
fpm Restart all installed PHP-FPM versions on your server
restart Restart all PHP-FPM pools and the active web server
uptime Monitor multiple server IPs for uptime/downtime