Skip to main content
LEARN / LINUX SYSTEMS ADMINISTRATION / PHASE 03

Find the failure.
Verify the recovery.

A Linux service can read its files and still fail to start. Learn how processes, systemd units, journal evidence, dependencies and software changes interact—then work through four original Northstar investigations.

Phase 03 / Service OperationsApplied troubleshooting4 original incidentsFree · No account
PHASE 03 / SERVICES, PROCESSES & SOFTWARE

Service recovery requires more than a successful restart command.

Phase 01 taught you to collect log evidence. Phase 02 taught you to evaluate the service account and access permissions. Phase 03 looks at the next layer: the process, the service manager, its configuration and dependencies, and whether the application actually starts and responds.

By the end, you should be able toDistinguish running from enabled; inspect processes and sockets; correlate systemctl and journalctl; reason about dependency and ordering directives; distinguish application reload, daemon-reload and restart; assess package and timer activity; and verify the outcome of a controlled service change.
01 / CONTINUE THE NORTHSTAR INCIDENT

The certificate is readable. Why is the service still down?

The previous phase established that the service account could open its certificate after an approved access correction. This new startup attempt passes the certificate check but exits before becoming active. The startup log reports an invalid application port value. Those are separate failures, and fixing one doesn't guarantee the other is resolved.

PREVIOUSLY VERIFIEDFile access is permitted

The modeled service account can read the approved certificate.

CURRENT FAILUREStartup preflight exits 2

Application configuration validation rejects an invalid LISTEN_PORT value.

Start with systemctl status for an overview, then look at the journal and effective service definition. The correct next question is what failed this time, not what fixed the previous incident.

Evidence-first principle

A log message is evidence of an observed operation, not automatic permission to change security settings. Keep hypotheses, proposed action and verified results separate.

02 / THE PROCESS BEHIND THE SERVICE

Find the right process before changing anything.

A Linux process has a PID, parent PID, user/group credentials, command line, state and resource usage. A service manager can supervise that process, restart it after failure or track its exit status, but the process and its unit file are not the same thing.

ps -eo pid,ppid,user,stat,cmdReview process identity

Inspect PIDs, parent relationships, users, states and commands.

topCheck current resource demand

Observe CPU, memory and active tasks before deciding whether resource contention matters.

pgrep -a northstar-webFind candidate PIDs

Match process names and inspect commands. Verify you have the correct process.

ss -ltnpInspect listening sockets

Correlate local TCP ports with owning processes where permissions allow.

Signals deserve care. SIGTERM requests a graceful stop where supported; SIGKILL forcibly terminates without normal cleanup. Do not start with kill -9 or forcefully stop an unrelated process just because it owns a port. Identify its owner, purpose and operational impact first.

A service configured with Restart=on-failure may repeatedly crash until rate limits prevent further starts. Adjusting restart delays or clearing a failed state doesn't correct an invalid configuration or an occupied port.

03 / THE SERVICE MANAGER

Active, enabled, disabled and masked mean different things.

On many modern distributions, systemd coordinates service processes and other unit types. The [Unit], [Service] and [Install] sections describe dependencies, execution and activation settings. Important directives include User, ExecStartPre, ExecStart, Environment and Restart.

Active

The unit is active; the application and client path still require separate validation.

Inactive

The unit is not currently active. For an exited oneshot job, this may be normal.

Failed

A start or runtime operation reported failure; inspect its result, exit status and journal.

Enabled

A unit is configured for automatic activation; it may still be failed or inactive now.

Disabled

Not enabled through install links, but may be started manually or as a dependency.

Masked

Intentionally blocked from activation; investigate maintenance or security holds before changing it.

systemctl start, stop and restart affect the current unit state. enable and disable manage installation/activation links and do not by themselves establish service health. A masked unit is deliberately blocked from activation; investigate the reason before removing the mask.

systemctl status northstar-web --no-pager

Review unit status, failed process exits and recent log lines.

systemctl is-active northstar-web.service

Check current active state; enablement is a separate question.

systemctl is-enabled northstar-web.service

Check installation/start-on-boot policy; enabled does not mean running.

journalctl -u northstar-web -b -n 30 --no-pager

Read 30 recent journal entries for the unit from the current boot.

systemctl cat northstar-web.service

Inspect the unit definition and drop-ins on disk.

systemctl show northstar-web -p NeedDaemonReload -p ExecStart

Examine the unit definition known to the manager and whether it needs reloading.

Read the systemctl manual ↗
04 / PUT THE ERRORS IN SEQUENCE

Use journalctl instead of guessing.

systemd-journald collects structured events from compatible services and the kernel. journalctl -u UNIT selects a unit; -b selects the current boot; -n 30 limits the number of recent records. --since and --until can narrow a maintenance window. Log permissions and retention may limit what you can inspect.

NORTHSTAR / FICTIONAL JOURNAL EXCERPT$ journalctl -u northstar-web -b -n 15 --no-pager
09:05:14 northstar-web: Certificate read check: PASS
09:05:15 northstar-web: Invalid LISTEN_PORT 'eighty-eighty'
09:05:15 systemd[1]: ExecStartPre exited with status 2
09:05:15 systemd[1]: Failed to start Northstar intranet

Correlate times with the last configuration or package change. Journal lines may identify the failing operation, but they don't necessarily prove the entire root cause. Missing journal records do not establish that an event never happened; the journal may be volatile, rotated or inaccessible to your account.

Read the journalctl manual ↗
05 / DEPENDENCY DOES NOT MEAN ORDER

Requires= and After= serve different purposes.

Wants= pulls in a weaker dependency, while Requires= expresses a stronger requirement when a unit is activated. After= expresses ordering, not a requirement by itself. Combining Requires= with After= may block a dependent unit's activation when the required ordered unit fails to start.

northstar-api.serviceRequires=northstar-queue.serviceAfter=northstar-queue.service
northstar-queue.servicemaskedApproved maintenance hold

When a required unit is masked intentionally, the right response isn't an automatic unmask or rewriting the dependency graph. Preserve the hold, identify the owner, document the failing dependency, and request authorization before changes. A justified escalation is an appropriate troubleshooting outcome even though the original application remains unavailable.

Other unit relationships such as BindsTo=, PartOf= and Conflicts= have their own semantics. Avoid assuming that all dependencies imply continuous health or automatic recovery.

Read systemd.unit dependency semantics ↗
06 / RELOAD ISN'T ALWAYS RESTART

Understand which configuration layer you changed.

systemctl reload UNITApplication-level reload

Requests a service-supported configuration reload; it does not make systemd re-read edited unit definitions.

systemctl daemon-reloadManager/unit reload

Re-reads systemd unit files and drop-ins, but does not by itself restart running application processes.

systemctl restart UNITNew service process

Stops then starts according to the loaded unit. Coordinate downtime and verify the new instance.

systemctl show UNIT -p NeedDaemonReloadManager metadata check

Check whether the unit files on disk differ from the manager's currently loaded definition.

After editing an application configuration, validate the syntax using an application-specific check before a controlled reload/restart. After editing a unit drop-in under /etc/systemd/system/, review systemctl cat and the manager's effective properties, then use daemon-reload and an approved restart if the updated ExecStart must take effect.

Change management

Preserve the prior configuration, identify dependencies and affected users, establish rollback criteria, obtain authorization, and verify health after the change. A successful command exit code is not proof of restored service.

07 / SOFTWARE IS PART OF THE INCIDENT

Package maintenance changes runtime behavior.

Linux distributions use package managers and repositories to distribute applications, libraries and security fixes. Debian/Ubuntu commonly use APT; many Red Hat-derived environments use DNF and RPM. Package updates can affect binaries, dependencies, service definitions and required restarts. Match your commands to the installed distribution.

apt update

Refresh the Debian/Ubuntu repository package index; it doesn't itself install upgrades.

apt list --upgradable

Inspect available upgrades before an approved maintenance window.

apt-cache policy PACKAGE

Check available versions, candidate selection and repository origin.

apt upgrade

Apply permitted package upgrades, potentially affecting running services.

dnf check-update

Check for updates on a supported DNF-based distribution.

dnf info PACKAGE

Inspect installed and candidate package metadata.

On Ubuntu, apt update refreshes index metadata whereas apt upgrade installs permitted upgrades. For scripts, Ubuntu generally recommends apt-get rather than interactive apt. A production change should review affected versions, package origins, dependencies, maintenance approvals, backup state and rollback options first.

If a service begins failing after patching, compare the change record, package history and journal evidence before attempting a downgrade. Never assume that another broad update will fix a version mismatch.

Ubuntu Server package management ↗
08 / SCHEDULED DOESN'T MEAN COMPLETED

Timers and cron need their own verification.

Linux supports cron schedules and systemd timers. A .timer unit schedules an associated service; the service performs the work. An enabled timer can fail to run when expected, or it may trigger successfully while the service itself exits with an error.

systemctl list-timers --allInspect schedule state

Compare last/next triggers and the unit each timer activates.

systemctl status northstar-job.timerReview timer activity

Check whether the timer is active and when its most recent trigger occurred.

journalctl -u northstar-job.serviceCheck execution results

Read the actual job service's logs and success/failure outcome.

crontab -lReview a user's cron entries

List the current user's crontab; system cron and other users may be separate.

Scheduled work needs approved credentials, predictable environment and working directories, resource controls, idempotence where practical, and failure monitoring. Timer enablement is not evidence of a successful backup or task. We'll study backups, recovery and monitoring in Phase 05.

09 / FOUR ORIGINAL SERVICE INCIDENTS

Diagnose, correct, and independently verify.

The investigations include a failed startup preflight, a masked dependency, a port conflict, and a stale unit definition after a reviewed drop-in change. Each asks you to inspect four evidence sources, justify the safest response, apply simulated steps in order and run two validation checks. No real Linux commands are executed.

HANDS-ON INVESTIGATIONS / PHASE 03

Northstar Service Recovery Workbench

Investigate systemd evidence, plan a justified response, apply a scoped simulated change, then separately verify the result.

0/4REVIEWED
INCIDENT 01 / northstar-web.service

Configuration passes access checks, but service still fails

Following the Phase 02 permission correction, northstar-web can read its TLS certificate. A new startup check now exits before the application becomes active.

INITIAL STATEfailed (Result: exit-code)Configuration validator exits 2: invalid LISTEN_PORT.
01 / Gather evidence0/4 inspected

Output is fictional and prewritten. Clicking an inspection does not run a command.

What the initial report establishes

Configuration validator exits 2: invalid LISTEN_PORT.

Read the other sources before inferring a cause.
02 / Justify the actionInspect all sources
What is the safest next step?

Inspect all four evidence sources to unlock the decision.

This is a deterministic service-state training simulation, not a real shell, operating system or monitoring platform.

10 / CHECK YOUR UNDERSTANDING

Can you choose the correct administrative evidence?

These six decisions reinforce runtime state, dependencies, journal filtering, package maintenance and timer operations. Revise answers after reading the explanation rather than memorizing a single command.

CHECK YOUR UNDERSTANDING / SYSTEMD, PACKAGES & TIMERS0/6 answered · 0 correct
01 Which command checks whether a systemd service is running right now?
02 What is the correct distinction between Requires= and After= in a unit?
03 What does systemctl daemon-reload do after a reviewed unit drop-in changes?
04 Which journalctl option limits output to the named unit?
05 On Ubuntu, what is the key difference between apt update and apt upgrade?
06 A systemd timer is enabled but its scheduled task never runs. What evidence should you inspect?
11 / VERIFY THE WHOLE WORKFLOW

A service that starts still needs an application test.

You've investigated three narrowly scoped simulated recoveries and one intentionally masked dependency that requires an owner's decision. Successful local checks are a starting point; external clients, upstream routing and sustained reliability may need further verification.

01 / IDENTIFYKnow the unit and process

Confirm owner, process, loaded definition and expected state.

02 / CORRELATERead journal and service evidence

Use timestamps, configuration and return codes to test hypotheses.

03 / CONTROLApply only approved corrections

Handle application configuration, unit overrides and dependencies differently.

04 / VERIFYTest the service and its consumers

Check active state, local endpoint, monitoring clients and rollback criteria.

NEXT IN THE CURRICULUM / PHASE 04

Linux Networking & Storage

Next we'll investigate IP addressing, routing, DNS, firewalls, listening services, disks, filesystems, persistent mounts and LVM. A locally healthy process can still be unreachable or unable to access data.

Continue to Phase 04 — Linux Networking & Storage →
PRACTICE & RELATED LEARNING

Read the lesson before starting the Northstar workbench. Each investigation requires evidence, a justified action and separate validation.

CONTINUE YOUR LEARNING PATH · LINUX SYSTEMS ADMINISTRATION

Continue to the next milestone

You've reached the end of this written lesson. Your next step is learn: Linux Networking & Storage. Complete that milestone before moving to the following lesson. You can revisit the explanation whenever you need it. Next: milestone 4 of 5.

Your completion marks are saved in this browser only.