Is the service running, and will it start at boot?

Synopsis

A service can be running after a one-time start, or stopped despite being enabled. Collect two observations at the same time on the same system. Inspect the current state, then ask how the service is selected at startup. An enabled service can still fail during boot if a dependency or its own startup procedure fails.

Use an ordinary account and a Bourne-style shell. On systems with zones, run zonename and record the result before querying the local service manager.

OmniOS

On OmniOS r151060, use the Service Management Facility (SMF) to inspect a Secure Shell (SSH) instance. The name ending in :default identifies a particular instance. If SSH is absent, select an existing instance from svcs -a and substitute its complete name in the assignment.

Shell input
service=svc:/network/ssh:default
svcs -l "$service"

Read the state field for the current condition. The enabled field describes the effective request and can carry a temporary qualification. Read the persistent setting separately.

Shell input
svcprop -c -p general/enabled "$service"

On the r151060 installation the SSH instance was online and the persistent value was true. The current state and the configured request therefore agreed. For an offline instance, run svcs -xv "$service" for the reason and svcs -d "$service" for its dependencies. The OmniOS report service example follows a persistently enabled instance to the failed service blocking it. When the report instance was temporarily disabled, svcs -l showed false (temporary) and state disabled. The separate general/enabled query still returned true. After reboot, the override had cleared and the instance was enabled again. Its state returned to offline because the required source remained in maintenance. The persistent setting correctly predicted the start request, even though the report could not run. OmniOS svcs(1) · OmniOS svcprop(1)

Oracle Solaris

Solaris 11.4 also uses SMF. Start with the instance state, then read the full configuration. The following commands select the instance used in Oracle’s documented temporary-enablement example if that instance is installed. Otherwise substitute an instance listed by svcs -a.

Shell input
service=svc:/application/management/net-snmp:default
svcs "$service"
svcs -l "$service"
svcprop -c -p general/enabled "$service"

Read the STATE column in the first result. In Oracle’s example the persistent setting is disabled, and the administrator temporarily enables the instance. Its detail then reports true (temporary) for enablement. A successful start under that override establishes the current state only. After reboot, SMF uses the persistent setting. Local dependencies can still prevent a service that is persistently enabled from reaching online. Oracle Solaris 11.4 service enablement

OpenBSD

On OpenBSD 8.0, check the SSH daemon using its service script.

Shell input
rcctl check sshd

The running daemon in the example returned sshd(ok). A failed check warrants inspection of the process and service logs. Some service scripts require root for a check. If the script reports insufficient privileges, obtain the result from an authorized administrator. OpenBSD 8.0 rc.d(8) · OpenBSD 8.0 rc.subr(8)

Check the effective startup configuration. Read the exit status immediately afterward.

Shell input
rcctl get sshd status
printf 'Startup query status: %s\n' "$?"

For a recognized daemon, zero means enabled and one means disabled. On the example installation the first command was silent and returned zero. Together, the two results establish that the SSH daemon was running and configured to start at boot. If the daemon is running while the startup query reports disabled, investigate how it was started. OpenBSD 8.0 rcctl(8)

Debian GNU/Linux

On Debian 13 with systemd as the service manager, inspect the journal service. The active state and the unit file’s installation state answer different questions.

Shell input
systemctl is-active systemd-journald.service
systemctl is-enabled systemd-journald.service

Example output on Debian 13.7

active
static

The journal service was active. A static unit lacks the installation instructions for direct enablement. Other units or activation mechanisms can bring it into a boot transaction. To inspect how other loaded units relate to the journal service, request reverse dependencies.

Shell input
systemctl list-dependencies --reverse --all --no-pager systemd-journald.service

For a conventional unit, enabled indicates persistent startup links and enabled-runtime indicates temporary links. A disabled unit can still start as a dependency. If the system manager is unavailable, as in some containers, record the scope of that failure. It leaves the host’s service state unknown. Debian 13 systemctl(1)

Report the result

Identify the host or zone, instance or unit, observed state, and mechanism that requests a start at boot. Give the reason for any discrepancy. The OpenBSD example supports a definite result for both checks. The Debian example supports a definite present state and calls for an investigation of what activates the static unit. For a separate question about the application itself, check a known application operation and record its outcome.

UNIX is a registered trademark of The Open Group.