Starting, enabling and reloading services
Quick answer
Runtime activity and automatic activation are different dimensions. A service may be active but disabled, or enabled but inactive.
Prepare the practice environment
Run python3 lab-fixtures/boot-services/setup.py from the extracted package root as an ordinary user in a disposable Linux environment. Enter the printed path and check pwd. Use a fresh fixture and a fresh Bash process for each offline example, with LC_ALL=C and set -o pipefail. Do not omit the explicit offline root. Read the fixture README before VM-only examples; never run those on the host. Static checks do not start a service.
How it works
systemctl start requests activation now; stop requests deactivation. enable creates installation links described by [Install] and does not start a service unless --now is used. disable removes installation links and does not necessarily stop it. Other units can still activate disabled services. mask blocks activation more strongly and is not ordinary troubleshooting. restart stops and starts; reload asks a supporting service to reload its own configuration; daemon-reload makes the manager reread unit definitions, not restart services. is-active and is-enabled answer different questions; both may return nonzero for negative answers. For a finite oneshot without RemainAfterExit, successful completion can be inactive.
For a periodic report, the timer is normally the unit enabled for future scheduling, while its service may be inactive between successful runs. An offline enablement link shows an installation relationship, not a running task or successful reboot. Also distinguish disabled from other non-success outcomes of is-enabled, including a missing unit; inspect the reported state instead of treating every nonzero exit as disabled.
Try the examples
if systemctl --root="$PWD/offline" is-enabled bm-report.service; then exit 1; else printf 'not enabled\n'; fiThe explicit root points to the fixture tree; no live manager is contacted.
Expected stdout:
disablednot enabledtest -f offline/etc/systemd/system/bm-report.servicesystemctl --root="$PWD/offline" enable bm-report.service > enable.log 2>&1test -L offline/etc/systemd/system/multi-user.target.wants/bm-report.servicesystemctl --root="$PWD/offline" is-enabled bm-report.serviceOnly the private synthetic root changes; the service is not started.
Expected stdout:
enabledsystemctl status bytemind-demo.service --no-pagersystemctl is-active bytemind-demo.servicesystemctl is-enabled bytemind-demo.serviceVM-only after the next lesson installs the sample; run separately and interpret nonzero states. No service changes here.
Manual example; not executed locally. Follow its stated environment restrictions.
Common mistakes
Never omit the explicit offline root in the fixture. Do not use restart or mask on an unrelated production unit. Reload and daemon-reload are not synonyms.
Practice
Run the offline enablement example in a fresh fixture and inspect the created symlink. Describe why no runtime process appears. In a VM, compare active and enabled states of the sample after the next lesson.
Related references
Study: systemctl. These are reference names, not deployed links.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Starting, enabling and reloading services — Knowledge Check
Apply boot and systemd concepts to offline unit files and VM-only scenarios.
Does enable alone start a service?
What does daemon-reload reload?
Can a disabled service be active?
What does --root=fixture do in the shown enable command?