← LFCS: Linux administration in production
01 / 7 · 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.

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