Interview Prep/Linux/systemd services and journald

After a reboot, a service that depends on an NFS mount starts before the mount and writes to the local disk.

IntermediateTroubleshootingsystemd services and journald
Answer

Likely causes → No dependency between the service and the mount; the service starts as soon as networking is up.

Diagnose →

systemctl list-dependencies myapp | grep mount
systemctl status mnt-share.mount

Fix → Add RequiresMountsFor=/mnt/share to the [Unit] section, which adds Requires= and After= on the mount unit.

Prevent → Always declare mount dependencies for services using network storage.

All Linux questions Roadmap: Linux

More on systemd services and journald