← LFCS: Linux administration in production
01 / 9 · 25 MIN

Services, scheduling, and persistent configuration

Distinguish service definition, the current process, and behavior after boot.

Concept and mechanism

A systemd unit, the process it started, and application configuration are related but different objects. If you change a drop-in using an external editor, daemon-reload lets the manager reread units. It does not automatically replace an existing process environment.

A controlled restart may be needed to start a process with new values. By contrast, systemctl edit normally reloads the manager when editing finishes; do not teach a sequence as though every edit behaves identically. reload requests service-specific reloading when supported.

Enable configures activation through dependencies, while start requests execution now. An enabled service can remain inactive.

Guided application

For APS handover, record identity, working directory, environment, dependencies, and success criteria. A batch reading conf/job.yml may work in a shell at /opt/funds and fail in a unit without WorkingDirectory. Do not solve path handling by running everything as root.

With calendar timers, Persistent=true may catch up after a missed activation, but does not guarantee separate replay of every missing batch. The application needs to identify already processed work. For kernel parameters, a runtime sysctl change does not replace persistent configuration and precedence checks.

If a process exits with 137, correlate OOM events and signals; that number alone does not identify the cause.

LFCS practice: systemd state, restart and configuration

Suggested exercise for a disposable Linux VM, never directly on a production service. Create a controlled demo unit with Environment=APP_MODE=initial, inspect its definition with systemctl cat, and record systemctl show -p MainPID -p ActiveState -p UnitFileState.

Change the variable through an approved drop-in and run systemctl daemon-reload, then inspect whether the existing process still has its previous PID. Daemon-reload updates what the manager reads; it does not recreate a process or replace that process environment.

Perform a controlled restart on the VM, check the new PID and environment, and inspect journalctl -u <unit> -b for failures. Also verify enabled versus active: a unit may be enabled yet stopped. Test activation after a controlled VM reboot when appropriate.

Acceptance evidence includes the right loaded unit definition, a running process, its changed environment, and verifiable startup logs. Revert the drop-in and document final state; a zero command exit status alone is not enough.

IN PRACTICE

Before rerunning a failed batch, check for partial files or transactions and use the intended reconciliation mechanism.

Common pitfalls

daemon-reload as restart; enabled as running; shell environment as service environment; timer as a queue of every missed batch.

Related topics: Packages, VMs, containers, and SELinux · Local networking, resolution, and SSH access

Take this idea with you

Validate definition, current execution, persistence, and work outcome separately.

Create account

Reference: systemd.exec(5) · LFCS current five-domain outline; exact edition date unconfirmed

LFCS is a trademark of The Linux Foundation. Linux® is a registered trademark of Linus Torvalds. bigsavant.com is an independent preparation platform and is not affiliated with, associated with, sponsored, authorised or endorsed by The Linux Foundation or Linus Torvalds. Content and questions are original, are not official exam questions, and completing our tests does not award or guarantee any certification. Names are used only to identify the subject. All other trademarks belong to their respective owners.